AUTH-2849 all log output to stderr
This commit is contained in:
parent
370c17e48c
commit
6fc9f1b405
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue