From 0f007373087bfb2d581f77a4a9a47941e5eeee6b Mon Sep 17 00:00:00 2001 From: "@aifsair" Date: Mon, 29 Jul 2019 19:00:30 +0200 Subject: [PATCH] Fix log config setup (#5807) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The return value of Set() was not checked. Hence, the typo ("al" instead of "af") wasn't catched. Signed-off-by: François (fser) --- web/api/v1/api_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/api/v1/api_test.go b/web/api/v1/api_test.go index a53f5fed2d..0499b40f47 100644 --- a/web/api/v1/api_test.go +++ b/web/api/v1/api_test.go @@ -274,9 +274,15 @@ func TestEndpoints(t *testing.T) { } al := promlog.AllowedLevel{} - al.Set("debug") + if err := al.Set("debug"); err != nil { + t.Fatal(err) + } + af := promlog.AllowedFormat{} - al.Set("logfmt") + if err := af.Set("logfmt"); err != nil { + t.Fatal(err) + } + promlogConfig := promlog.Config{ Level: &al, Format: &af,