MCPcopy Create free account
hub / github.com/DoNewsCode/core / Log

Method Log

logging/log.go:108–117  ·  view source on GitHub ↗
(keyvals ...interface{})

Source from the content-addressed store, hash-verified

106}
107
108func (s spanLogger) Log(keyvals ...interface{}) error {
109 for k := range s.kvs {
110 if f, ok := s.kvs[k].(log.Valuer); ok {
111 s.kvs[k] = f()
112 }
113 }
114 s.kvs = append(s.kvs, keyvals...)
115 s.span.LogKV(s.kvs...)
116 return s.base.Log(keyvals...)
117}
118
119// WithContext decorates the log.Logger with information form context. If there is an opentracing span
120// in the context, the span will receive the logger output as well.

Callers 15

httpServeMethod · 0.80
grpcServeMethod · 0.80
WriteMethod · 0.80
InfofMethod · 0.80
ErrorMethod · 0.80
PrintfMethod · 0.80
TestWithContextFunction · 0.80
TestSpanLoggerFunction · 0.80
Example_minimalFunction · 0.80
Example_levelFunction · 0.80
ExampleWithContextFunction · 0.80

Calls 1

LogKVMethod · 0.65

Tested by 8

TestWithContextFunction · 0.64
TestSpanLoggerFunction · 0.64
Example_minimalFunction · 0.64
Example_levelFunction · 0.64
ExampleWithContextFunction · 0.64
TestJobOptionFunction · 0.64
TestHook_rawFunction · 0.64