log message with Sprint, Sprintf, or neither.
(lvl zapcore.Level, template string, fmtArgs []interface{}, context []interface{})
| 344 | |
| 345 | // log message with Sprint, Sprintf, or neither. |
| 346 | func (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 |
| 360 | func (s *SugaredLogger) logln(lvl zapcore.Level, fmtArgs []interface{}, context []interface{}) { |
no test coverage detected