MCPcopy Index your code
hub / github.com/coder/slog / Example_marshaller

Function Example_marshaller

example_marshaller_test.go:23–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23func Example_marshaller() {
24 l := slog.Make(sloghuman.Sink(os.Stdout))
25
26 l.Info(context.Background(), "wow",
27 slog.F("myStruct", myStruct{
28 foo: 1,
29 bar: 2,
30 }),
31 )
32
33 // 2019-12-16 17:31:37.120 [INFO] <example_marshaller_test.go:26> wow {"myStruct": {"foo": 1, "bar": 1}}
34}

Callers

nothing calls this directly

Calls 2

SinkFunction · 0.92
InfoMethod · 0.80

Tested by

no test coverage detected