From b26d956e07852e31402c41018d5d4dd9807a9f0c Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 4 Dec 2016 00:30:59 +0800 Subject: [PATCH] fix #752 ignore appengine os. Signed-off-by: Bo-Yi Wu --- logger.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/logger.go b/logger.go index b4743a7f..ad442d0c 100644 --- a/logger.go +++ b/logger.go @@ -8,6 +8,7 @@ import ( "fmt" "io" "os" + "runtime" "time" "golang.org/x/crypto/ssh/terminal" @@ -48,8 +49,11 @@ func Logger() HandlerFunc { // Example: os.Stdout, a file opened in write mode, a socket... func LoggerWithWriter(out io.Writer, notlogged ...string) HandlerFunc { isTerm := true - if outFile, ok := out.(*os.File); ok { - isTerm = terminal.IsTerminal(int(outFile.Fd())) + + if runtime.GOOS != "appengine" && runtime.GOOS != "netbsd" && runtime.GOOS != "openbsd" { + if outFile, ok := out.(*os.File); ok { + isTerm = terminal.IsTerminal(int(outFile.Fd())) + } } var skip map[string]struct{}