Switched default logger to stdout instead of stderr
This commit is contained in:
parent
ba7db545fe
commit
43676f045c
1 changed files with 1 additions and 1 deletions
|
@ -87,7 +87,7 @@ func InitLogger() {
|
||||||
|
|
||||||
// GetLogWriter returns the writer to where the normal log goes, depending on the config
|
// GetLogWriter returns the writer to where the normal log goes, depending on the config
|
||||||
func GetLogWriter(logfile string) (writer io.Writer) {
|
func GetLogWriter(logfile string) (writer io.Writer) {
|
||||||
writer = os.Stderr // Set the default case to prevent nil pointer panics
|
writer = os.Stdout // Set the default case to prevent nil pointer panics
|
||||||
switch viper.GetString("log." + logfile) {
|
switch viper.GetString("log." + logfile) {
|
||||||
case "file":
|
case "file":
|
||||||
f, err := os.OpenFile(config.LogPath.GetString()+"/"+logfile+".log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
f, err := os.OpenFile(config.LogPath.GetString()+"/"+logfile+".log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
||||||
|
|
Loading…
Reference in a new issue