5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-26 04:21:38 +00:00

Add support for DEBUG=1 envvar to enable debug. Closes #283

This commit is contained in:
Wim 2017-10-28 14:50:35 +02:00
parent b7a8c6b60f
commit b461fc5e40

View File

@ -7,6 +7,7 @@ import (
"github.com/42wim/matterbridge/gateway" "github.com/42wim/matterbridge/gateway"
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
"github.com/google/gops/agent" "github.com/google/gops/agent"
"os"
"strings" "strings"
) )
@ -33,7 +34,7 @@ func main() {
fmt.Printf("version: %s %s\n", version, githash) fmt.Printf("version: %s %s\n", version, githash)
return return
} }
if *flagDebug { if *flagDebug || os.Getenv("DEBUG") == "1" {
log.Info("Enabling debug") log.Info("Enabling debug")
log.SetLevel(log.DebugLevel) log.SetLevel(log.DebugLevel)
} }