You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
468 B
24 lines
468 B
package log_test
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gitoa.ru/go-4devs/log"
|
|
"gitoa.ru/go-4devs/log/level"
|
|
)
|
|
|
|
func ExampleDebug() {
|
|
logger := log.New(log.WithStdout()).With(
|
|
log.WithSource(2),
|
|
log.WithLevel(log.KeyLevel, level.Debug),
|
|
log.WithExit(level.Alert),
|
|
log.WithPanic(level.Emergency),
|
|
)
|
|
|
|
log.SetLogger(logger)
|
|
|
|
ctx := context.Background()
|
|
log.Debug(ctx, "debug message")
|
|
// Output:
|
|
// msg="debug message" source=log/global_example_test.go:21 level=debug
|
|
}
|
|
|