go-logger/colors_unix.go

11 lines
229 B
Go
Raw Permalink Normal View History

2023-04-02 10:01:29 +00:00
//go:build unix
2023-04-01 18:03:16 +00:00
package logger
import "os"
func (c colorConfig) isColoringSupported() bool {
// Check if $TERM variable is set. Almost every terminal does support coloring in linux
return os.Getenv("TERM") != ""
}