Skip to content

Commit d6ce3b9

Browse files
chore: remove redundant arg from logln (#1136)
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.
1 parent e3a10fc commit d6ce3b9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

sugar.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -231,38 +231,38 @@ func (s *SugaredLogger) Fatalw(msg string, keysAndValues ...interface{}) {
231231

232232
// Debugln uses fmt.Sprintln to construct and log a message.
233233
func (s *SugaredLogger) Debugln(args ...interface{}) {
234-
s.logln(DebugLevel, "", args, nil)
234+
s.logln(DebugLevel, args, nil)
235235
}
236236

237237
// Infoln uses fmt.Sprintln to construct and log a message.
238238
func (s *SugaredLogger) Infoln(args ...interface{}) {
239-
s.logln(InfoLevel, "", args, nil)
239+
s.logln(InfoLevel, args, nil)
240240
}
241241

242242
// Warnln uses fmt.Sprintln to construct and log a message.
243243
func (s *SugaredLogger) Warnln(args ...interface{}) {
244-
s.logln(WarnLevel, "", args, nil)
244+
s.logln(WarnLevel, args, nil)
245245
}
246246

247247
// Errorln uses fmt.Sprintln to construct and log a message.
248248
func (s *SugaredLogger) Errorln(args ...interface{}) {
249-
s.logln(ErrorLevel, "", args, nil)
249+
s.logln(ErrorLevel, args, nil)
250250
}
251251

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

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

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

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

287287
// logln message with Sprintln
288-
func (s *SugaredLogger) logln(lvl zapcore.Level, template string, fmtArgs []interface{}, context []interface{}) {
288+
func (s *SugaredLogger) logln(lvl zapcore.Level, fmtArgs []interface{}, context []interface{}) {
289289
if lvl < DPanicLevel && !s.base.Core().Enabled(lvl) {
290290
return
291291
}

0 commit comments

Comments
 (0)