Skip to content

Commit b26d956

Browse files
committed
fix gin-gonic#752 ignore appengine os.
Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 32cab50 commit b26d956

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

logger.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"fmt"
99
"io"
1010
"os"
11+
"runtime"
1112
"time"
1213

1314
"golang.org/x/crypto/ssh/terminal"
@@ -48,8 +49,11 @@ func Logger() HandlerFunc {
4849
// Example: os.Stdout, a file opened in write mode, a socket...
4950
func LoggerWithWriter(out io.Writer, notlogged ...string) HandlerFunc {
5051
isTerm := true
51-
if outFile, ok := out.(*os.File); ok {
52-
isTerm = terminal.IsTerminal(int(outFile.Fd()))
52+
53+
if runtime.GOOS != "appengine" && runtime.GOOS != "netbsd" && runtime.GOOS != "openbsd" {
54+
if outFile, ok := out.(*os.File); ok {
55+
isTerm = terminal.IsTerminal(int(outFile.Fd()))
56+
}
5357
}
5458

5559
var skip map[string]struct{}

0 commit comments

Comments
 (0)