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

Function ExampleLogger_Warn

log_example_test.go:139–147  ·  log_example_test.go::ExampleLogger_Warn
()

Source from the content-addressed store, hash-verified

137}
138
139func ExampleLogger_Warn() {
140 log := zerolog.New(os.Stdout)
141
142 log.Warn().
143 Str("foo", "bar").
144 Msg("a warning message")
145
146 // Output: {"level":"warn","foo":"bar","message":"a warning message"}
147}
148
149func ExampleLogger_Error() {
150 log := zerolog.New(os.Stdout)

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
MsgMethod · 0.80
WarnMethod · 0.80
StrMethod · 0.45

Tested by

no test coverage detected