github.com/lastbackend/toolkit@v0.0.0-20241020043710-cafa37b95aad/pkg/runtime/logger/empty/empty.go (about) 1 package empty 2 3 import ( 4 "github.com/lastbackend/toolkit/pkg/runtime/logger" 5 "go.uber.org/fx/fxevent" 6 ) 7 8 type emptyLogger struct { 9 logger.Logger 10 } 11 12 func (l *emptyLogger) WithFields(_ logger.Fields) logger.Logger { 13 return l 14 } 15 16 func (l *emptyLogger) Init(_ logger.Options) logger.Logger { 17 return l 18 } 19 20 func (l *emptyLogger) Options() logger.Options { 21 return logger.Options{} 22 } 23 24 func (l *emptyLogger) Debug(_ ...interface{}) {} 25 func (l *emptyLogger) Debugf(_ string, _ ...interface{}) {} 26 func (l *emptyLogger) Info(_ ...interface{}) {} 27 func (l *emptyLogger) Infof(_ string, _ ...interface{}) {} 28 func (l *emptyLogger) Warn(_ ...interface{}) {} 29 func (l *emptyLogger) Warnf(_ string, _ ...interface{}) {} 30 func (l *emptyLogger) Error(_ ...interface{}) {} 31 func (l *emptyLogger) Errorf(_ string, _ ...interface{}) {} 32 func (l *emptyLogger) Panic(_ ...interface{}) {} 33 func (l *emptyLogger) Panicf(_ string, _ ...interface{}) {} 34 func (l *emptyLogger) Fatal(_ ...interface{}) {} 35 func (l *emptyLogger) Fatalf(_ string, _ ...interface{}) {} 36 func (l *emptyLogger) V(logger.Level) logger.Logger { 37 return l 38 } 39 40 func (l *emptyLogger) Inject(_ func(level logger.Level)) { 41 42 } 43 44 func (l *emptyLogger) Fx() fxevent.Logger { 45 return fxevent.NopLogger 46 } 47 48 func NewLogger() logger.Logger { 49 return new(emptyLogger) 50 }