qrz/vendor/github.com/gobuffalo/logger/terminal_check.go

20 lines
233 B
Go
Raw Normal View History

// +build !appengine
package logger
import (
"io"
"os"
2021-08-30 19:45:06 +02:00
"golang.org/x/term"
)
func checkIfTerminal(w io.Writer) bool {
switch v := w.(type) {
case *os.File:
2021-08-30 19:45:06 +02:00
return term.IsTerminal(int(v.Fd()))
default:
return false
}
}