Skip to content

Commit

Permalink
Add group name to Windows logger
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa committed Dec 27, 2023
1 parent 155edc2 commit 56f9d58
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions logging/logger_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 56f9d58

Please sign in to comment.