summaryrefslogtreecommitdiffstats
path: root/utils/config.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-09-27 07:07:32 -0700
committerenahum <nahumhbl@gmail.com>2016-09-27 11:07:32 -0300
commitbfca752940a13c874788b0c885d36b2b263bd4fb (patch)
tree3b49bbb91b0f397f5c68644c3d9f79f240855b10 /utils/config.go
parent667db6e10c7bf4d3856a1f94eaad34d9e03352c1 (diff)
downloadchat-bfca752940a13c874788b0c885d36b2b263bd4fb.tar.gz
chat-bfca752940a13c874788b0c885d36b2b263bd4fb.tar.bz2
chat-bfca752940a13c874788b0c885d36b2b263bd4fb.zip
Fixing the console level debug statements (#4092)
Diffstat (limited to 'utils/config.go')
-rw-r--r--utils/config.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/utils/config.go b/utils/config.go
index 2c4113009..c67de906e 100644
--- a/utils/config.go
+++ b/utils/config.go
@@ -31,6 +31,7 @@ var CfgDiagnosticId = ""
var CfgHash = ""
var CfgFileName string = ""
var ClientCfg map[string]string = map[string]string{}
+var originalDisableDebugLvl l4g.Level = l4g.DEBUG
func FindConfigFile(fileName string) string {
if _, err := os.Stat("./config/" + fileName); err == nil {
@@ -56,11 +57,16 @@ func FindDir(dir string) string {
}
func DisableDebugLogForTest() {
- l4g.Global["stdout"].Level = l4g.WARNING
+ if l4g.Global["stdout"] != nil {
+ originalDisableDebugLvl = l4g.Global["stdout"].Level
+ l4g.Global["stdout"].Level = l4g.WARNING
+ }
}
func EnableDebugLogForTest() {
- l4g.Global["stdout"].Level = l4g.DEBUG
+ if l4g.Global["stdout"] != nil {
+ l4g.Global["stdout"].Level = originalDisableDebugLvl
+ }
}
func ConfigureCmdLineLog() {