2018-10-02 14:28:04 +00:00
|
|
|
// +build !appengine,!js,!windows
|
2018-01-22 11:16:03 +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
|
|
|
|
}
|
|
|
|
}
|