From 76bf959da85c4c73f865a295149d3d4c9a3aae3d Mon Sep 17 00:00:00 2001 From: Sylvain Prost Date: Thu, 19 Dec 2024 16:39:57 +0100 Subject: [PATCH] pkg/log: expose level fetch --- log/logger.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/log/logger.go b/log/logger.go index 47a7400..c3aa685 100644 --- a/log/logger.go +++ b/log/logger.go @@ -24,7 +24,7 @@ var ( log.WithSink( multi.NewSink( leveled.NewSink( - fetchLevel(), + FetchLevel(), writer.NewStdoutSink(writer.NewDefaultFormatter(localPkg)), ), leveled.NewSink( @@ -49,7 +49,7 @@ func RegisterContextExtractor(ce log.ContextExtractor) { Logger = log.NewLogger(loggerOpts...) } -func fetchLevel() record.Level { +func FetchLevel() record.Level { switch strings.ToUpper(cfg.FetchString("LOGGER_LEVEL", "")) { case "DEBUG": return record.Debug