2023-11-24 15:23:07 +03:00
|
|
|
package logger
|
|
|
|
|
|
|
|
import (
|
|
|
|
"go.uber.org/zap"
|
|
|
|
"go.uber.org/zap/zapcore"
|
|
|
|
)
|
|
|
|
|
2024-06-07 17:55:45 +03:00
|
|
|
// Nil logger doesn't do anything.
|
2023-11-24 15:23:07 +03:00
|
|
|
type Nil struct{}
|
|
|
|
|
2024-06-07 17:55:45 +03:00
|
|
|
// NewNil constructs new *Nil.
|
2023-11-24 15:23:07 +03:00
|
|
|
func NewNil() Logger {
|
|
|
|
return &Nil{}
|
|
|
|
}
|
|
|
|
|
2024-06-14 18:10:48 +03:00
|
|
|
func (l *Nil) With(_ ...zap.Field) Logger {
|
2023-11-24 15:23:07 +03:00
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
2024-06-14 18:10:48 +03:00
|
|
|
func (l *Nil) WithLazy(_ ...zap.Field) Logger {
|
2023-11-24 15:23:07 +03:00
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (l *Nil) Level() zapcore.Level {
|
|
|
|
return zapcore.DebugLevel
|
|
|
|
}
|
|
|
|
|
2024-06-14 18:10:48 +03:00
|
|
|
func (l *Nil) Check(_ zapcore.Level, _ string) *zapcore.CheckedEntry {
|
2023-11-24 15:23:07 +03:00
|
|
|
return &zapcore.CheckedEntry{}
|
|
|
|
}
|
|
|
|
|
2024-06-14 18:10:48 +03:00
|
|
|
func (l *Nil) Log(_ zapcore.Level, _ string, _ ...zap.Field) {}
|
2023-11-24 15:23:07 +03:00
|
|
|
|
2024-06-14 18:10:48 +03:00
|
|
|
func (l *Nil) Debug(_ string, _ ...zap.Field) {}
|
2023-11-24 15:23:07 +03:00
|
|
|
|
2024-06-14 18:10:48 +03:00
|
|
|
func (l *Nil) Info(_ string, _ ...zap.Field) {}
|
2023-11-24 15:23:07 +03:00
|
|
|
|
2024-06-14 18:10:48 +03:00
|
|
|
func (l *Nil) Warn(_ string, _ ...zap.Field) {}
|
2023-11-24 15:23:07 +03:00
|
|
|
|
2024-06-14 18:10:48 +03:00
|
|
|
func (l *Nil) Error(_ string, _ ...zap.Field) {}
|
2023-11-24 15:23:07 +03:00
|
|
|
|
2024-06-14 18:10:48 +03:00
|
|
|
func (l *Nil) DPanic(_ string, _ ...zap.Field) {}
|
2023-11-24 15:23:07 +03:00
|
|
|
|
2024-06-14 18:10:48 +03:00
|
|
|
func (l *Nil) Panic(_ string, _ ...zap.Field) {}
|
2023-11-24 15:23:07 +03:00
|
|
|
|
2024-06-14 18:10:48 +03:00
|
|
|
func (l *Nil) Fatal(_ string, _ ...zap.Field) {}
|
2023-11-24 15:23:07 +03:00
|
|
|
|
2024-06-14 18:10:48 +03:00
|
|
|
func (l *Nil) ForHandler(_ any) Logger {
|
2024-01-19 13:17:04 +03:00
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
2024-06-14 18:10:48 +03:00
|
|
|
func (l *Nil) ForConnection(_ any) Logger {
|
2024-01-19 13:17:04 +03:00
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
2024-06-14 18:10:48 +03:00
|
|
|
func (l *Nil) ForAccount(_ any) Logger {
|
2023-11-24 15:23:07 +03:00
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
|
|
|
func (l *Nil) Sync() error {
|
|
|
|
return nil
|
|
|
|
}
|