blob: 3b9d2864ca34644151d5dbc04d35446c67006540 [file] [log] [blame]
khenaidoo59ce9dd2019-11-11 13:05:32 -05001// +build !appengine,!js,windows
2
3package logrus
4
5import (
6 "io"
7 "os"
8 "syscall"
9)
10
11func checkIfTerminal(w io.Writer) bool {
12 switch v := w.(type) {
13 case *os.File:
14 var mode uint32
15 err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode)
16 return err == nil
17 default:
18 return false
19 }
20}