TestLogRotation add log output relative path

TestLogRotation add test log output relative path test
This commit is contained in:
Mr-Mu 2021-05-27 22:49:41 +08:00 committed by GitHub
parent 24d8e90dbc
commit 0e496ca212
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -311,6 +311,11 @@ func TestLogRotation(t *testing.T) {
logOutputs: []string{"stderr", "/tmp/path"},
logRotationConfig: `{"maxsize": 1}`,
},
{
name: "log output relative path",
logOutputs: []string{"stderr", "tmp/path"},
logRotationConfig: `{"maxsize": 1}`,
},
{
name: "no file targets",
logOutputs: []string{"stderr"},
@ -368,6 +373,9 @@ func TestLogRotation(t *testing.T) {
if err == nil && tt.wantErr {
t.Errorf("test %q, expected error, got nil", tt.name)
}
if err == nil {
cfg.GetLogger().Info("test log")
}
})
}
}