Fixing the console level debug statements (#4092)

This commit is contained in:
Corey Hulen
2016-09-27 07:07:32 -07:00
committed by enahum
parent 667db6e10c
commit bfca752940
6 changed files with 13 additions and 12 deletions

View File

@@ -154,7 +154,6 @@ func TestEmailTest(t *testing.T) {
if _, err := th.SystemAdminClient.TestEmail(utils.Cfg); err == nil {
t.Fatal("should have errored")
} else {
println(err.Id)
if err.Id != "api.admin.test_email.missing_server" {
t.Fatal(err)
}

View File

@@ -564,7 +564,9 @@ func TestGetTeamMembers(t *testing.T) {
t.Fatal(err)
} else {
members := result.Data.([]*model.TeamMember)
t.Log(members)
if members == nil {
t.Fatal("should be valid")
}
}
}

View File

@@ -55,7 +55,7 @@
"AtRestEncryptKey": ""
},
"LogSettings": {
"EnableConsole": true,
"EnableConsole": false,
"ConsoleLevel": "DEBUG",
"EnableFile": true,
"FileLevel": "INFO",

View File

@@ -766,8 +766,6 @@ func TestGetMemberCount(t *testing.T) {
}
Must(store.Channel().Save(&c2))
t.Logf("c1.Id = %v", c1.Id)
u1 := &model.User{
Email: model.NewId(),
DeleteAt: 0,
@@ -872,8 +870,6 @@ func TestUpdateExtrasByUser(t *testing.T) {
}
Must(store.Channel().Save(&c2))
t.Logf("c1.Id = %v", c1.Id)
u1 := &model.User{
Email: model.NewId(),
DeleteAt: 0,

View File

@@ -880,15 +880,13 @@ func TestPostCountsByDay(t *testing.T) {
o2a = Must(store.Post().Save(o2a)).(*model.Post)
time.Sleep(1 * time.Second)
t.Log(t1.Id)
if r1 := <-store.Post().AnalyticsPostCountsByDay(t1.Id); r1.Err != nil {
t.Fatal(r1.Err)
} else {
row1 := r1.Data.(model.AnalyticsRows)[0]
if row1.Value != 2 {
t.Log(row1)
t.Fatal("wrong value")
t.Fatal(row1)
}
row2 := r1.Data.(model.AnalyticsRows)[1]

View File

@@ -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() {