mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-21 13:23:09 +01:00
Add NO_COLOR support (#384)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -17,10 +17,13 @@ func Configure(cli *model.Cli) {
|
||||
var err error
|
||||
var w io.Writer
|
||||
|
||||
// Adds support for NO_COLOR. More info https://no-color.org/
|
||||
_, noColor := os.LookupEnv("NO_COLOR")
|
||||
|
||||
if !cli.LogJSON {
|
||||
w = zerolog.ConsoleWriter{
|
||||
Out: os.Stdout,
|
||||
NoColor: cli.LogNoColor,
|
||||
NoColor: noColor || cli.LogNoColor,
|
||||
TimeFormat: time.RFC1123,
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user