Skip to content

Commit

Permalink
fix gin-gonic#752 ignore appengine os.
Browse files Browse the repository at this point in the history
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Dec 3, 2016
1 parent 32cab50 commit b26d956
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"io"
"os"
"runtime"
"time"

"golang.org/x/crypto/ssh/terminal"
Expand Down Expand Up @@ -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{}
Expand Down

0 comments on commit b26d956

Please sign in to comment.