Skip to content

Commit

Permalink
fix: Correct color configuration in CLI
Browse files Browse the repository at this point in the history
- Fixed the logic for `color.NoColor` by inverting the `opts.Color` flag to ensure color output behaves as expected.
- Note: This change will result in logs being output without color by default, whereas previously they were colored by default.
  • Loading branch information
soh335 committed Sep 25, 2024
1 parent 9e925e9 commit cd17b58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ func CLI(ctx context.Context, parse CLIParseFunc) (int, error) {
return 1, err
}

color.NoColor = opts.Color
color.NoColor = !opts.Color
filter := &logutils.LevelFilter{
Levels: []logutils.LogLevel{"trace", "debug", "info", "warn", "error"},
ModifierFuncs: []logutils.ModifierFunc{
logutils.Color(color.FgHiWhite), // trace
logutils.Color(color.FgHiWhite), // trace
logutils.Color(color.FgHiBlack), // debug
nil, // info
logutils.Color(color.FgYellow), // warn
Expand Down

0 comments on commit cd17b58

Please sign in to comment.