From 83ab2fbb139824705a4e1d5afcfa0501a51008e5 Mon Sep 17 00:00:00 2001 From: Randell Date: Thu, 28 Nov 2024 10:19:45 -0700 Subject: [PATCH] Fix naming --- log/log.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/log/log.go b/log/log.go index c184073..c9361c7 100644 --- a/log/log.go +++ b/log/log.go @@ -9,10 +9,10 @@ import ( func New(level Level, output Output) *slog.Logger { var h slog.Handler switch output { - case OutputJson: + case OutputJSON: h = slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{Level: level.ToSlog()}) case OutputText: - h = slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{Level: level.ToSlog()}) + fallthrough default: h = slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{Level: level.ToSlog()}) } @@ -75,8 +75,8 @@ func GetLevel() Level { type Output string const ( - // OutputJson is the JSON log output. - OutputJson Output = "json" + // OutputJSON is the JSON log output. + OutputJSON Output = "json" // OutputText is the text log output. OutputText Output = "text" ) @@ -85,7 +85,7 @@ const ( func ToOutput(output string) Output { switch output { case "json": - return OutputJson + return OutputJSON case "text": return OutputText default: