summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/Sirupsen/logrus/terminal_solaris.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/Sirupsen/logrus/terminal_solaris.go')
-rw-r--r--vendor/github.com/Sirupsen/logrus/terminal_solaris.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/vendor/github.com/Sirupsen/logrus/terminal_solaris.go b/vendor/github.com/Sirupsen/logrus/terminal_solaris.go
index 3e70bf7b..3c86b1ab 100644
--- a/vendor/github.com/Sirupsen/logrus/terminal_solaris.go
+++ b/vendor/github.com/Sirupsen/logrus/terminal_solaris.go
@@ -1,15 +1,21 @@
-// +build solaris
+// +build solaris,!appengine
package logrus
import (
+ "io"
"os"
"golang.org/x/sys/unix"
)
// IsTerminal returns true if the given file descriptor is a terminal.
-func IsTerminal() bool {
- _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA)
- return err == nil
+func IsTerminal(f io.Writer) bool {
+ switch v := f.(type) {
+ case *os.File:
+ _, err := unix.IoctlGetTermios(int(v.Fd()), unix.TCGETA)
+ return err == nil
+ default:
+ return false
+ }
}