Skip to content

Commit

Permalink
chore: remove redundant arg from logln (#1136)
Browse files Browse the repository at this point in the history
logln takes a redundant "template" argument that's never used.
This was likely modeled after the existing `log(..)` method
which does use its template argument.
  • Loading branch information
sashamelentyev authored Jul 22, 2022
1 parent e3a10fc commit d6ce3b9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions sugar.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,38 +231,38 @@ func (s *SugaredLogger) Fatalw(msg string, keysAndValues ...interface{}) {

// Debugln uses fmt.Sprintln to construct and log a message.
func (s *SugaredLogger) Debugln(args ...interface{}) {
s.logln(DebugLevel, "", args, nil)
s.logln(DebugLevel, args, nil)
}

// Infoln uses fmt.Sprintln to construct and log a message.
func (s *SugaredLogger) Infoln(args ...interface{}) {
s.logln(InfoLevel, "", args, nil)
s.logln(InfoLevel, args, nil)
}

// Warnln uses fmt.Sprintln to construct and log a message.
func (s *SugaredLogger) Warnln(args ...interface{}) {
s.logln(WarnLevel, "", args, nil)
s.logln(WarnLevel, args, nil)
}

// Errorln uses fmt.Sprintln to construct and log a message.
func (s *SugaredLogger) Errorln(args ...interface{}) {
s.logln(ErrorLevel, "", args, nil)
s.logln(ErrorLevel, args, nil)
}

// DPanicln uses fmt.Sprintln to construct and log a message. In development, the
// logger then panics. (See DPanicLevel for details.)
func (s *SugaredLogger) DPanicln(args ...interface{}) {
s.logln(DPanicLevel, "", args, nil)
s.logln(DPanicLevel, args, nil)
}

// Panicln uses fmt.Sprintln to construct and log a message, then panics.
func (s *SugaredLogger) Panicln(args ...interface{}) {
s.logln(PanicLevel, "", args, nil)
s.logln(PanicLevel, args, nil)
}

// Fatalln uses fmt.Sprintln to construct and log a message, then calls os.Exit.
func (s *SugaredLogger) Fatalln(args ...interface{}) {
s.logln(FatalLevel, "", args, nil)
s.logln(FatalLevel, args, nil)
}

// Sync flushes any buffered log entries.
Expand All @@ -285,7 +285,7 @@ func (s *SugaredLogger) log(lvl zapcore.Level, template string, fmtArgs []interf
}

// logln message with Sprintln
func (s *SugaredLogger) logln(lvl zapcore.Level, template string, fmtArgs []interface{}, context []interface{}) {
func (s *SugaredLogger) logln(lvl zapcore.Level, fmtArgs []interface{}, context []interface{}) {
if lvl < DPanicLevel && !s.base.Core().Enabled(lvl) {
return
}
Expand Down

0 comments on commit d6ce3b9

Please sign in to comment.