MCPcopy
hub / github.com/nektos/act / isColored

Method isColored

pkg/runner/logger.go:249–261  ·  view source on GitHub ↗
(entry *logrus.Entry)

Source from the content-addressed store, hash-verified

247}
248
249func (f *jobLogFormatter) isColored(entry *logrus.Entry) bool {
250 isColored := checkIfTerminal(entry.Logger.Out)
251
252 if force, ok := os.LookupEnv("CLICOLOR_FORCE"); ok && force != "0" {
253 isColored = true
254 } else if ok && force == "0" {
255 isColored = false
256 } else if os.Getenv("CLICOLOR") == "0" {
257 isColored = false
258 }
259
260 return isColored
261}
262
263func checkIfTerminal(w io.Writer) bool {
264 switch v := w.(type) {

Callers 1

FormatMethod · 0.95

Calls 2

checkIfTerminalFunction · 0.85
GetenvMethod · 0.65

Tested by

no test coverage detected