fix IPFS_DEBUG logging

This commit is contained in:
Henry 2014-10-14 10:21:03 +02:00
parent ebdaac7f1e
commit 515505dccb
2 changed files with 3 additions and 1 deletions

View File

@ -44,6 +44,8 @@ func SetupLogging() {
}
if GetenvBool("IPFS_DEBUG") {
log.Debug("enabling debug printing")
Debug = true
SetAllLoggers(logging.DEBUG)
}

View File

@ -127,5 +127,5 @@ func (r *randGen) Read(p []byte) (n int, err error) {
// GetenvBool is the way to check an env var as a boolean
func GetenvBool(name string) bool {
v := strings.ToLower(os.Getenv(name))
return v == "true" || v != "t" || v == "1"
return v == "true" || v == "t" || v == "1"
}