@@ -82,9 +82,6 @@ func NewDevelopmentLogger(selector string, options ...LogOption) (*Logger, error
8282 return nil , err
8383 }
8484 logger = logger .Named (selector )
85- if err != nil {
86- return nil , err
87- }
8885 return & Logger {logger , logger .Sugar (), make (map [string ]struct {})}, nil
8986}
9087
@@ -224,37 +221,58 @@ func (l *Logger) IsDebug() bool {
224221
225222// Debugf uses fmt.Sprintf to construct and log a message.
226223func (l * Logger ) Debugf (format string , args ... interface {}) {
224+ if false {
225+ _ = fmt .Sprintf (format , args ... ) // enable printf checking
226+ }
227227 l .sugar .Debugf (format , args ... )
228228}
229229
230230// Infof uses fmt.Sprintf to log a templated message.
231231func (l * Logger ) Infof (format string , args ... interface {}) {
232+ if false {
233+ _ = fmt .Sprintf (format , args ... ) // enable printf checking
234+ }
232235 l .sugar .Infof (format , args ... )
233236}
234237
235238// Warnf uses fmt.Sprintf to log a templated message.
236239func (l * Logger ) Warnf (format string , args ... interface {}) {
240+ if false {
241+ _ = fmt .Sprintf (format , args ... ) // enable printf checking
242+ }
237243 l .sugar .Warnf (format , args ... )
238244}
239245
240246// Errorf uses fmt.Sprintf to log a templated message.
241247func (l * Logger ) Errorf (format string , args ... interface {}) {
248+ if false {
249+ _ = fmt .Sprintf (format , args ... ) // enable printf checking
250+ }
242251 l .sugar .Errorf (format , args ... )
243252}
244253
245254// Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit(1).
246255func (l * Logger ) Fatalf (format string , args ... interface {}) {
256+ if false {
257+ _ = fmt .Sprintf (format , args ... ) // enable printf checking
258+ }
247259 l .sugar .Fatalf (format , args ... )
248260}
249261
250262// Panicf uses fmt.Sprintf to log a templated message, then panics.
251263func (l * Logger ) Panicf (format string , args ... interface {}) {
264+ if false {
265+ _ = fmt .Sprintf (format , args ... ) // enable printf checking
266+ }
252267 l .sugar .Panicf (format , args ... )
253268}
254269
255270// DPanicf uses fmt.Sprintf to log a templated message. In development, the
256271// logger then panics.
257272func (l * Logger ) DPanicf (format string , args ... interface {}) {
273+ if false {
274+ _ = fmt .Sprintf (format , args ... ) // enable printf checking
275+ }
258276 l .sugar .DPanicf (format , args ... )
259277}
260278
0 commit comments