Skip to content

Commit

Permalink
change consoleLogger assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
fredcarle committed Jun 29, 2022
1 parent 11e01d5 commit ec766af
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions logging/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,14 @@ func (l *logger) ApplyConfig(config Config) {
_ = l.logger.Sync()
l.logger = newLogger

// clear the console logger in case we don't need it anymore
l.consoleLogger = nil

if !willOutputToStderr(config.OutputPaths) {
if config.pipe != nil { // for testing purposes only
l.consoleLogger = stdlog.New(config.pipe, "", 0)
return
} else {
l.consoleLogger = stdlog.New(os.Stderr, "", 0)
}
l.consoleLogger = stdlog.New(os.Stderr, "", 0)
} else {
l.consoleLogger = nil
}
}

Expand Down

0 comments on commit ec766af

Please sign in to comment.