-
-
Notifications
You must be signed in to change notification settings - Fork 136
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
The following code exists in config.go:
func (c *Config) Sanitize() error {
if c.LogOutput == nil {
c.LogOutput = os.Stderr
}
if c.LogLevel == "" {
c.LogLevel = DefaultLogLevel
}
if c.LogVerbosity <= 0 {
c.LogVerbosity = DefaultLogVerbosity
}
if c.Logger == nil {
c.Logger = log.New(c.LogOutput, "", log.LstdFlags)
} else {
c.Logger.SetOutput(c.LogOutput) // <-- !
}
// ...If you provide a custom logger, the else branch overrides that logger's output. That's very unexpected behaviour, as it is mutating the logger for all its users.
I think you can remove the else branch and things will work as expected?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working