fix: Get logger configuration from app.conf file (#1907)

* feat: Get logger configuration from file

* feat: Get logger configuration from file

* Remove GetConfigLogs()
This commit is contained in:
Sergey Zabodalov
2023-05-30 16:30:09 +03:00
committed by GitHub
parent 4c8648d323
commit 10e66f8020
3 changed files with 18 additions and 1 deletions

View File

@ -109,3 +109,19 @@ func TestGetConfigQuota(t *testing.T) {
assert.Equal(t, scenery.expected, quota)
}
}
func TestGetConfigLogs(t *testing.T) {
scenarios := []struct {
description string
expected string
}{
{"Default log config", `{"filename": "logs/casdoor.log", "maxdays":99999, "perm":"0770"}`},
}
err := beego.LoadAppConfig("ini", "app.conf")
assert.Nil(t, err)
for _, scenery := range scenarios {
quota := GetConfigString("logConfig")
assert.Equal(t, scenery.expected, quota)
}
}