-
Notifications
You must be signed in to change notification settings - Fork 880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
utils/logger: colorize outputs to terminal #1312
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1312 +/- ##
==========================================
+ Coverage 59.32% 59.34% +0.02%
==========================================
Files 126 126
Lines 21466 21482 +16
==========================================
+ Hits 12734 12749 +15
+ Misses 7201 7195 -6
- Partials 1531 1538 +7
Continue to review full report at Codecov.
|
for i := 3; i < 6; i++ { | ||
l.prefixes[i] = fmt.Sprintf("\033[1;%dm%s\033[0m", 30+i, ps[i]) | ||
} | ||
l.prefixes[6] = fmt.Sprintf("\033[1;%dm%s\033[0m", 35, ps[6]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we provide a flag to disable this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better do it; but it may be conflicted with flags of subcommands, like:
./juicefs stats -h
--nocolor disable colors (default: false)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use it as a global option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Workable
No description provided.