set log level at startup

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

No files matched your search

+2 -2
View File
@@ -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)
}
+1 -1
View File
@@ -15,7 +15,7 @@ import (
func main() {
r := httprouter.New()
web.Init(r, "")
web.Init(r, "", true)
err := http.ListenAndServe(":8081", r)