MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / LogColorDisabled

Function LogColorDisabled

app/cli/cmd/color.go:47–49  ·  view source on GitHub ↗

LogColorDisabled reports whether colorized log output should be disabled. It follows the same approach as the supports-color/chalk family: honor the NO_COLOR / FORCE_COLOR conventions, then enable color on an interactive terminal or in a CI system known to render ANSI escape codes.

()

Source from the content-addressed store, hash-verified

45// NO_COLOR / FORCE_COLOR conventions, then enable color on an interactive
46// terminal or in a CI system known to render ANSI escape codes.
47func LogColorDisabled() bool {
48 return !colorSupported(os.LookupEnv, term.IsTerminal(int(os.Stderr.Fd())))
49}
50
51// colorSupported decides whether ANSI color should be emitted, given a way to
52// look up environment variables and whether stderr is an interactive terminal.

Callers 1

mainFunction · 0.92

Calls 1

colorSupportedFunction · 0.85

Tested by

no test coverage detected