diff --git a/.travis.yml b/.travis.yml index 33051749..53f436f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,9 @@ language: go sudo: false go: - 1.4 - - 1.5 - - 1.6 - - 1.7 + - 1.5.4 + - 1.6.4 + - 1.7.4 - tip script: diff --git a/logger.go b/logger.go index ad442d0c..7c2a72be 100644 --- a/logger.go +++ b/logger.go @@ -8,10 +8,9 @@ import ( "fmt" "io" "os" - "runtime" "time" - "golang.org/x/crypto/ssh/terminal" + "github.com/mattn/go-isatty" ) var ( @@ -50,10 +49,8 @@ func Logger() HandlerFunc { func LoggerWithWriter(out io.Writer, notlogged ...string) HandlerFunc { isTerm := true - if runtime.GOOS != "appengine" && runtime.GOOS != "netbsd" && runtime.GOOS != "openbsd" { - if outFile, ok := out.(*os.File); ok { - isTerm = terminal.IsTerminal(int(outFile.Fd())) - } + if w, ok := out.(*os.File); !ok || !isatty.IsTerminal(w.Fd()) { + isTerm = false } var skip map[string]struct{}