blob: cf309d6fb6e660ce7a50bbc1ed8b41a46abf562f [file] [log] [blame]
khenaidoo59ce9dd2019-11-11 13:05:32 -05001// +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}