From 0e496ca2127b09dc113f933072c1ca3c9ced3d79 Mon Sep 17 00:00:00 2001 From: Mr-Mu <530148599@qq.com> Date: Thu, 27 May 2021 22:49:41 +0800 Subject: [PATCH] TestLogRotation add log output relative path TestLogRotation add test log output relative path test --- server/embed/config_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/embed/config_test.go b/server/embed/config_test.go index 8e36006bc..38fd37bfe 100644 --- a/server/embed/config_test.go +++ b/server/embed/config_test.go @@ -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") + } }) } }