Respect GOLOG_LOG_FMT=color
This commit is contained in:
parent
140a2e0200
commit
4dd59b566c
@ -6,4 +6,9 @@ import (
|
||||
"github.com/mattn/go-isatty"
|
||||
)
|
||||
|
||||
var DefaultColorUse = isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd())
|
||||
// DefaultColorUse is the globally referenced variable for all Lotus CLI tools
|
||||
// It sets to `true` if STDOUT is a TTY or if the variable GOLOG_LOG_FMT is set
|
||||
// to color (as recognizd by github.com/ipfs/go-log/v2)
|
||||
var DefaultColorUse = os.Getenv("GOLOG_LOG_FMT") == "color" ||
|
||||
isatty.IsTerminal(os.Stdout.Fd()) ||
|
||||
isatty.IsCygwinTerminal(os.Stdout.Fd())
|
||||
|
Loading…
Reference in New Issue
Block a user