From 3cc982459f20b56f5110d5a7cf24ad3ccc9c196b Mon Sep 17 00:00:00 2001 From: Hubert Grochowski Date: Fri, 7 Jun 2024 16:51:47 +0200 Subject: [PATCH] log: change level type to string That would eliminate the zero value issue with flags. Fixes #832 --- log/level.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/log/level.go b/log/level.go index 9c555673..eb60b96b 100644 --- a/log/level.go +++ b/log/level.go @@ -6,14 +6,14 @@ package log -type Level int32 +type Level string const ( - ErrorLevel Level = iota - InfoLevel - DebugLevel + ErrorLevel Level = "error" + InfoLevel Level = "info" + DebugLevel Level = "debug" ) func (l Level) String() string { - return [3]string{"error", "info", "debug"}[l] + return string(l) }