From 6b46e1a0d8e8ad786562229c4c2f96c234fb4b48 Mon Sep 17 00:00:00 2001 From: Wim Brand Date: Wed, 15 Aug 2018 10:11:31 +0200 Subject: [PATCH] set log level at startup --- init/init.go | 4 ++-- main.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/init/init.go b/init/init.go index 06a05d0..40c20e3 100644 --- a/init/init.go +++ b/init/init.go @@ -11,7 +11,7 @@ import ( ) // 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()) var webconf = &conf.PixelWebConfig{} @@ -27,7 +27,7 @@ func Init(r *httprouter.Router, prefix string) { os.Exit(1) } - if !webconf.DebugMode { + if !webconf.DebugMode && setLogLevel { log.SetLogLevel(log.LevelInfo) } diff --git a/main.go b/main.go index 34c1191..d21dd97 100644 --- a/main.go +++ b/main.go @@ -15,7 +15,7 @@ import ( func main() { r := httprouter.New() - web.Init(r, "") + web.Init(r, "", true) err := http.ListenAndServe(":8081", r)