MCPcopy
hub / github.com/rs/zerolog / ExampleLogger_Write

Function ExampleLogger_Write

log_example_test.go:168–179  ·  log_example_test.go::ExampleLogger_Write
()

Source from the content-addressed store, hash-verified

166}
167
168func ExampleLogger_Write() {
169 log := zerolog.New(os.Stdout).With().
170 Str("foo", "bar").
171 Logger()
172
173 stdlog.SetFlags(0)
174 stdlog.SetOutput(log)
175
176 stdlog.Print("hello world")
177
178 // Output: {"foo":"bar","message":"hello world"}
179}
180
181func ExampleLogger_Log() {
182 log := zerolog.New(os.Stdout)

Callers

nothing calls this directly

Calls 5

NewFunction · 0.92
LoggerMethod · 0.80
WithMethod · 0.80
PrintMethod · 0.80
StrMethod · 0.45

Tested by

no test coverage detected