MCPcopy
hub / github.com/go-kit/kit / Example_valuer

Function Example_valuer

log/example_test.go:62–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60}
61
62func Example_valuer() {
63 logger := log.NewLogfmtLogger(os.Stdout)
64
65 count := 0
66 counter := func() interface{} {
67 count++
68 return count
69 }
70
71 logger = log.With(logger, "count", log.Valuer(counter))
72
73 logger.Log("call", "first")
74 logger.Log("call", "second")
75
76 // Output:
77 // count=1 call=first
78 // count=2 call=second
79}
80
81func Example_debugInfo() {
82 logger := log.NewLogfmtLogger(os.Stdout)

Callers

nothing calls this directly

Calls 3

NewLogfmtLoggerFunction · 0.92
WithFunction · 0.92
LogMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…