From 56f9d58e009a348837bc87f70e6617503cb5b42b Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Wed, 27 Dec 2023 11:08:05 +0100 Subject: [PATCH] Add group name to Windows logger --- logging/logger_windows.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/logging/logger_windows.go b/logging/logger_windows.go index 54a3de52..eb59525a 100644 --- a/logging/logger_windows.go +++ b/logging/logger_windows.go @@ -34,6 +34,9 @@ type LoggerConfig struct { MaxAge int Compress bool LocalTime bool + + // group name + Name string } // NewLogger creates a new logger with the given configuration. @@ -82,6 +85,7 @@ func NewLogger(ctx context.Context, cfg LoggerConfig) zerolog.Logger { multiWriter := zerolog.MultiLevelWriter(outputs...) logger := zerolog.New(multiWriter) logger = logger.With().Timestamp().Logger() + logger = logger.With().Str("group", cfg.Name).Logger() span.End()