MCPcopy Create free account
hub / github.com/go-logr/logr / ExampleLogger_WithValues

Function ExampleLogger_WithValues

example_test.go:75–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73}
74
75func ExampleLogger_WithValues() {
76 l := NewStdoutLogger()
77 l = l.WithValues("stringVal", "value", "intVal", 12345)
78 l = l.WithValues("boolVal", true)
79 l.Info("this is an info log", "floatVal", 3.1415)
80 // Output:
81 // "level"=0 "msg"="this is an info log" "stringVal"="value" "intVal"=12345 "boolVal"=true "floatVal"=3.1415
82}
83
84func ExampleLogger_V() {
85 l := NewStdoutLogger()

Callers

nothing calls this directly

Calls 3

NewStdoutLoggerFunction · 0.70
WithValuesMethod · 0.65
InfoMethod · 0.65

Tested by

no test coverage detected