@@ -82,9 +82,6 @@ func NewDevelopmentLogger(selector string, options ...LogOption) (*Logger, error
82
82
return nil , err
83
83
}
84
84
logger = logger .Named (selector )
85
- if err != nil {
86
- return nil , err
87
- }
88
85
return & Logger {logger , logger .Sugar (), make (map [string ]struct {})}, nil
89
86
}
90
87
@@ -224,37 +221,58 @@ func (l *Logger) IsDebug() bool {
224
221
225
222
// Debugf uses fmt.Sprintf to construct and log a message.
226
223
func (l * Logger ) Debugf (format string , args ... interface {}) {
224
+ if false {
225
+ _ = fmt .Sprintf (format , args ... ) // enable printf checking
226
+ }
227
227
l .sugar .Debugf (format , args ... )
228
228
}
229
229
230
230
// Infof uses fmt.Sprintf to log a templated message.
231
231
func (l * Logger ) Infof (format string , args ... interface {}) {
232
+ if false {
233
+ _ = fmt .Sprintf (format , args ... ) // enable printf checking
234
+ }
232
235
l .sugar .Infof (format , args ... )
233
236
}
234
237
235
238
// Warnf uses fmt.Sprintf to log a templated message.
236
239
func (l * Logger ) Warnf (format string , args ... interface {}) {
240
+ if false {
241
+ _ = fmt .Sprintf (format , args ... ) // enable printf checking
242
+ }
237
243
l .sugar .Warnf (format , args ... )
238
244
}
239
245
240
246
// Errorf uses fmt.Sprintf to log a templated message.
241
247
func (l * Logger ) Errorf (format string , args ... interface {}) {
248
+ if false {
249
+ _ = fmt .Sprintf (format , args ... ) // enable printf checking
250
+ }
242
251
l .sugar .Errorf (format , args ... )
243
252
}
244
253
245
254
// Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit(1).
246
255
func (l * Logger ) Fatalf (format string , args ... interface {}) {
256
+ if false {
257
+ _ = fmt .Sprintf (format , args ... ) // enable printf checking
258
+ }
247
259
l .sugar .Fatalf (format , args ... )
248
260
}
249
261
250
262
// Panicf uses fmt.Sprintf to log a templated message, then panics.
251
263
func (l * Logger ) Panicf (format string , args ... interface {}) {
264
+ if false {
265
+ _ = fmt .Sprintf (format , args ... ) // enable printf checking
266
+ }
252
267
l .sugar .Panicf (format , args ... )
253
268
}
254
269
255
270
// DPanicf uses fmt.Sprintf to log a templated message. In development, the
256
271
// logger then panics.
257
272
func (l * Logger ) DPanicf (format string , args ... interface {}) {
273
+ if false {
274
+ _ = fmt .Sprintf (format , args ... ) // enable printf checking
275
+ }
258
276
l .sugar .DPanicf (format , args ... )
259
277
}
260
278
0 commit comments