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

Function ExampleLogger_Info

log_example_test.go:128–137  ·  log_example_test.go::ExampleLogger_Info
()

Source from the content-addressed store, hash-verified

126}
127
128func ExampleLogger_Info() {
129 log := zerolog.New(os.Stdout)
130
131 log.Info().
132 Str("foo", "bar").
133 Int("n", 123).
134 Msg("hello world")
135
136 // Output: {"level":"info","foo":"bar","n":123,"message":"hello world"}
137}
138
139func ExampleLogger_Warn() {
140 log := zerolog.New(os.Stdout)

Callers

nothing calls this directly

Calls 5

NewFunction · 0.92
MsgMethod · 0.80
InfoMethod · 0.65
IntMethod · 0.45
StrMethod · 0.45

Tested by

no test coverage detected