set log level at startup

This commit is contained in:
Wim Brand
2018-08-15 10:11:31 +02:00
parent 7c800a6452
commit 6b46e1a0d8
2 changed files with 3 additions and 3 deletions

View File

@@ -11,7 +11,7 @@ import (
) )
// Init initializes the Pixeldrain Web UI controllers // Init initializes the Pixeldrain Web UI controllers
func Init(r *httprouter.Router, prefix string) { func Init(r *httprouter.Router, prefix string, setLogLevel bool) {
log.Info("Starting web UI server (PID %v)", os.Getpid()) log.Info("Starting web UI server (PID %v)", os.Getpid())
var webconf = &conf.PixelWebConfig{} var webconf = &conf.PixelWebConfig{}
@@ -27,7 +27,7 @@ func Init(r *httprouter.Router, prefix string) {
os.Exit(1) os.Exit(1)
} }
if !webconf.DebugMode { if !webconf.DebugMode && setLogLevel {
log.SetLogLevel(log.LevelInfo) log.SetLogLevel(log.LevelInfo)
} }

View File

@@ -15,7 +15,7 @@ import (
func main() { func main() {
r := httprouter.New() r := httprouter.New()
web.Init(r, "") web.Init(r, "", true)
err := http.ListenAndServe(":8081", r) err := http.ListenAndServe(":8081", r)