summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/admin_test.go1
-rw-r--r--api/team_test.go4
-rw-r--r--config/config.json2
-rw-r--r--store/sql_channel_store_test.go4
-rw-r--r--store/sql_post_store_test.go4
-rw-r--r--utils/config.go10
6 files changed, 13 insertions, 12 deletions
diff --git a/api/admin_test.go b/api/admin_test.go
index c758bd4fe..445d2de38 100644
--- a/api/admin_test.go
+++ b/api/admin_test.go
@@ -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)
}
diff --git a/api/team_test.go b/api/team_test.go
index 936ba696b..1a66a826f 100644
--- a/api/team_test.go
+++ b/api/team_test.go
@@ -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")
+ }
}
}
diff --git a/config/config.json b/config/config.json
index dde478089..44e52d88e 100644
--- a/config/config.json
+++ b/config/config.json
@@ -55,7 +55,7 @@
"AtRestEncryptKey": ""
},
"LogSettings": {
- "EnableConsole": true,
+ "EnableConsole": false,
"ConsoleLevel": "DEBUG",
"EnableFile": true,
"FileLevel": "INFO",
diff --git a/store/sql_channel_store_test.go b/store/sql_channel_store_test.go
index 519fdea6a..d7d99f581 100644
--- a/store/sql_channel_store_test.go
+++ b/store/sql_channel_store_test.go
@@ -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,
diff --git a/store/sql_post_store_test.go b/store/sql_post_store_test.go
index 594e923be..6105cbace 100644
--- a/store/sql_post_store_test.go
+++ b/store/sql_post_store_test.go
@@ -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]
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() {