2019-02-25 16:29:48 +05:00
|
|
|
// +build !appengine,!js,!windows,!aix
|
2018-02-02 09:17:40 +05: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
|
|
|
|
}
|
|
|
|
}
|