many: unify boolean env var handling

This commit is contained in:
John R. Lenton
2016-11-23 15:57:09 +00:00
parent 8f62673834
commit 5241ccb8bb
9 changed files with 118 additions and 15 deletions
+3 -1
View File
@@ -27,6 +27,8 @@ import (
"log/syslog"
"os"
"sync"
"github.com/snapcore/snapd/osutil"
)
// A Logger is a fairly minimal logging tool.
@@ -109,7 +111,7 @@ func (l *ConsoleLog) Debug(msg string) {
s := "DEBUG: " + msg
l.sys.Output(3, s)
if os.Getenv("SNAPD_DEBUG") != "" {
if osutil.EnvBool("SNAPD_DEBUG") {
l.log.Output(3, s)
}
}