fix #752 ignore appengine os.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-12-04 00:30:59 +08:00
parent 32cab500ec
commit b26d956e07
1 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,7 @@ import (
"fmt" "fmt"
"io" "io"
"os" "os"
"runtime"
"time" "time"
"golang.org/x/crypto/ssh/terminal" "golang.org/x/crypto/ssh/terminal"
@ -48,8 +49,11 @@ func Logger() HandlerFunc {
// Example: os.Stdout, a file opened in write mode, a socket... // Example: os.Stdout, a file opened in write mode, a socket...
func LoggerWithWriter(out io.Writer, notlogged ...string) HandlerFunc { func LoggerWithWriter(out io.Writer, notlogged ...string) HandlerFunc {
isTerm := true 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{} var skip map[string]struct{}