blob: cf309d6fb6e660ce7a50bbc1ed8b41a46abf562f [file] [log] [blame]
Matteo Scandolo1f49bf52018-11-20 13:56:45 -08001// +build !appengine,!js,!windows
2
3package logrus
4
5import (
6 "io"
7 "os"
8
9 "golang.org/x/crypto/ssh/terminal"
10)
11
12func checkIfTerminal(w io.Writer) bool {
13 switch v := w.(type) {
14 case *os.File:
15 return terminal.IsTerminal(int(v.Fd()))
16 default:
17 return false
18 }
19}