2018-10-06 18:08:21 +00:00
|
|
|
// +build !appengine,!js,!windows
|
2018-05-05 14:57:47 +00:00
|
|
|
|
|
|
|
package logrus
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"golang.org/x/crypto/ssh/terminal"
|
|
|
|
)
|
|
|
|
|
|
|
|
func checkIfTerminal(w io.Writer) bool {
|
|
|
|
switch v := w.(type) {
|
|
|
|
case *os.File:
|
|
|
|
return terminal.IsTerminal(int(v.Fd()))
|
|
|
|
default:
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|