allow setting config when you use your own logger implementation

This commit is contained in:
shedyfreak 2023-11-06 17:01:56 +01:00
parent 9fea15ae75
commit b371257bac

View File

@ -128,6 +128,13 @@ func (l *logger) LogMode(level LogLevel) Interface {
return &newlogger return &newlogger
} }
// SetConfig Allow setting configs for your own log implementation
func (l *logger) SetConfig(config Config) Interface {
newlogger := *l
newlogger.Config = config
return &newlogger
}
// Info print info // Info print info
func (l logger) Info(ctx context.Context, msg string, data ...interface{}) { func (l logger) Info(ctx context.Context, msg string, data ...interface{}) {
if l.LogLevel >= Info { if l.LogLevel >= Info {