From 19c0972cf68c65e6081ca78cd866733d9ceb38b8 Mon Sep 17 00:00:00 2001 From: Kit Patella Date: Thu, 31 Oct 2024 08:52:33 -0700 Subject: [PATCH] use console slogger no color as text Signed-off-by: Kit Patella --- src/pkg/logger/logger.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pkg/logger/logger.go b/src/pkg/logger/logger.go index bd17269772..82e98d44e6 100644 --- a/src/pkg/logger/logger.go +++ b/src/pkg/logger/logger.go @@ -134,7 +134,10 @@ func New(cfg Config) (*slog.Logger, error) { switch cfg.Format.ToLower() { case FormatText: - handler = slog.NewTextHandler(cfg.Destination, &opts) + handler = console.NewHandler(cfg.Destination, &console.HandlerOptions{ + Level: slog.Level(cfg.Level), + NoColor: true, + }) case FormatJSON: handler = slog.NewJSONHandler(cfg.Destination, &opts) case FormatConsole: