From 29d4e8bfbc01d220c1036ea882be97d08d9ee43d Mon Sep 17 00:00:00 2001 From: Dmitry Mordvinov Date: Thu, 14 May 2026 15:16:22 +0300 Subject: [PATCH] fix: add SetupColorLevel function for enhanced logging color configuration (for werf) Signed-off-by: Dmitry Mordvinov --- pkg/action/setup_logging.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/action/setup_logging.go b/pkg/action/setup_logging.go index f5b02516..ae0fec97 100644 --- a/pkg/action/setup_logging.go +++ b/pkg/action/setup_logging.go @@ -114,12 +114,16 @@ func SetupLogging(ctx context.Context, logLevel log.Level, opts SetupLoggingOpti panic(fmt.Sprintf("unknown log level %q", logLevel)) } + SetupColorLevel(opts) + + return ctx +} + +func SetupColorLevel(opts SetupLoggingOptions) { colorLevel := getColorLevel(opts.ColorMode, opts.LogIsParseable) color.Enable = colorLevel != terminfo.ColorLevelNone color.ForceSetColorLevel(colorLevel) - - return ctx } func getColorLevel(mode string, logIsParseable bool) terminfo.ColorLevel {