Closed
Description
package config
import (
"os"
"github.com/labstack/gommon/log"
)
// SetLoggerOutput sets the log path
func SetLoggerOutput(cfgLogPath string, debug string) error {
if debug == "true" {
log.SetOutput(os.Stderr)
log.SetLevel(log.DEBUG)
} else {
logPath, err := os.OpenFile(cfgLogPath, os.O_APPEND|os.O_CREATE, 0755)
if err != nil {
return err
}
log.SetOutput(logPath)
log.SetLevel(log.WARN)
}
return nil
}
Regardless of the value of debug
it always writes to os.Stderr
. I ditched Logrus for Echo's logger. Thanks for the awesome framework!