MCPcopy
hub / github.com/uber-go/zap / log

Method log

sugar.go:346–357  ·  view source on GitHub ↗

log message with Sprint, Sprintf, or neither.

(lvl zapcore.Level, template string, fmtArgs []interface{}, context []interface{})

Source from the content-addressed store, hash-verified

344
345// log message with Sprint, Sprintf, or neither.
346func (s *SugaredLogger) log(lvl zapcore.Level, template string, fmtArgs []interface{}, context []interface{}) {
347 // If logging at this level is completely disabled, skip the overhead of
348 // string formatting.
349 if lvl < DPanicLevel && !s.base.Core().Enabled(lvl) {
350 return
351 }
352
353 msg := getMessage(template, fmtArgs)
354 if ce := s.base.Check(lvl, msg); ce != nil {
355 ce.Write(s.sweetenFields(context)...)
356 }
357}
358
359// logln message with Sprintln
360func (s *SugaredLogger) logln(lvl zapcore.Level, fmtArgs []interface{}, context []interface{}) {

Callers 15

LogMethod · 0.95
DebugMethod · 0.95
InfoMethod · 0.95
WarnMethod · 0.95
ErrorMethod · 0.95
DPanicMethod · 0.95
PanicMethod · 0.95
FatalMethod · 0.95
LogfMethod · 0.95
DebugfMethod · 0.95
InfofMethod · 0.95
WarnfMethod · 0.95

Calls 6

sweetenFieldsMethod · 0.95
CoreMethod · 0.80
getMessageFunction · 0.70
EnabledMethod · 0.65
CheckMethod · 0.65
WriteMethod · 0.65

Tested by

no test coverage detected