MCPcopy Create free account
hub / github.com/coder/slog / ExampleStdlib

Function ExampleStdlib

example_test.go:101–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99}
100
101func ExampleStdlib() {
102 ctx := slog.With(context.Background(), slog.F("field", 1))
103 l := slog.Stdlib(ctx, slog.Make(sloghuman.Sink(os.Stdout)), slog.LevelInfo)
104
105 l.Print("msg")
106
107 // 2019-12-07 20:54:23.986 [INFO] (stdlib) msg field=1
108}
109
110func ExampleLogger_Named() {
111 ctx := context.Background()

Callers

nothing calls this directly

Calls 3

SinkFunction · 0.92
WithMethod · 0.80
PrintMethod · 0.80

Tested by

no test coverage detected