From b461fc5e404c6e0df7289477171cad629cddb3e6 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 28 Oct 2017 14:50:35 +0200 Subject: [PATCH] Add support for DEBUG=1 envvar to enable debug. Closes #283 --- matterbridge.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/matterbridge.go b/matterbridge.go index aa1cebd7..e62b6be8 100644 --- a/matterbridge.go +++ b/matterbridge.go @@ -7,6 +7,7 @@ import ( "github.com/42wim/matterbridge/gateway" log "github.com/Sirupsen/logrus" "github.com/google/gops/agent" + "os" "strings" ) @@ -33,7 +34,7 @@ func main() { fmt.Printf("version: %s %s\n", version, githash) return } - if *flagDebug { + if *flagDebug || os.Getenv("DEBUG") == "1" { log.Info("Enabling debug") log.SetLevel(log.DebugLevel) }