AUTH-2849 all log output to stderr

This commit is contained in:
Dalton 2020-06-26 17:37:58 -05:00 committed by Adam Chalmers
parent 370c17e48c
commit 6fc9f1b405
1 changed files with 2 additions and 13 deletions

View File

@ -115,20 +115,9 @@ func New(opts ...Option) (Service, error) {
if !config.terminalOutputDisabled { if !config.terminalOutputDisabled {
if len(config.supportedTerminalLevels) == 0 { if len(config.supportedTerminalLevels) == 0 {
l.Add(os.Stdout, NewTerminalFormatter(""), InfoLevel) l.Add(os.Stderr, NewTerminalFormatter(""), InfoLevel, ErrorLevel, FatalLevel)
l.Add(os.Stderr, NewTerminalFormatter(""), ErrorLevel, FatalLevel)
} else { } else {
errLevels := []Level{} l.Add(os.Stderr, NewTerminalFormatter(""), config.supportedTerminalLevels...)
outLevels := []Level{}
for _, level := range config.supportedTerminalLevels {
if level == ErrorLevel || level == FatalLevel {
errLevels = append(errLevels, level)
} else {
outLevels = append(outLevels, level)
}
}
l.Add(os.Stdout, NewTerminalFormatter(""), outLevels...)
l.Add(os.Stderr, NewTerminalFormatter(""), errLevels...)
} }
} }
return l, nil return l, nil