From 98bbc0107f27a53686984d5e6e40a21778b88d19 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 b86d0d6c2..d0ff013f8 100644 --- a/server/embed/config_test.go +++ b/server/embed/config_test.go @@ -304,6 +304,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"}, @@ -361,6 +366,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") + } }) } }