mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fixing the console level debug statements (#4092)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
"AtRestEncryptKey": ""
|
||||
},
|
||||
"LogSettings": {
|
||||
"EnableConsole": true,
|
||||
"EnableConsole": false,
|
||||
"ConsoleLevel": "DEBUG",
|
||||
"EnableFile": true,
|
||||
"FileLevel": "INFO",
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user