Skip to content

Commit

Permalink
feat: use console-slogger as text handler (#3167)
Browse files Browse the repository at this point in the history
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
  • Loading branch information
mkcp authored Oct 31, 2024
1 parent 4c0521a commit 1e906ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1e906ff

Please sign in to comment.