(entry *logrus.Entry)
| 247 | } |
| 248 | |
| 249 | func (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 | |
| 263 | func checkIfTerminal(w io.Writer) bool { |
| 264 | switch v := w.(type) { |
no test coverage detected