Skip to content

Commit 8fe117b

Browse files
authored
Merge pull request #943 from tandr/unexport-isterminal
Unexport IsTerminal
2 parents a6c0064 + ede5b63 commit 8fe117b

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

terminal/terminal_check_bsd.go renamed to terminal_check_bsd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// +build darwin dragonfly freebsd netbsd openbsd
22

3-
package terminal
3+
package logrus
44

55
import "golang.org/x/sys/unix"
66

77
const ioctlReadTermios = unix.TIOCGETA
88

9-
func IsTerminal(fd int) bool {
9+
func isTerminal(fd int) bool {
1010
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
1111
return err == nil
1212
}

terminal_check_notappengine.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ package logrus
55
import (
66
"io"
77
"os"
8-
9-
"github.com/sirupsen/logrus/terminal"
108
)
119

1210
func checkIfTerminal(w io.Writer) bool {
1311
switch v := w.(type) {
1412
case *os.File:
15-
return terminal.IsTerminal(int(v.Fd()))
13+
return isTerminal(int(v.Fd()))
1614
default:
1715
return false
1816
}

terminal/terminal_check_unix.go renamed to terminal_check_unix.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// +build linux aix
22

3-
package terminal
3+
package logrus
44

55
import "golang.org/x/sys/unix"
66

77
const ioctlReadTermios = unix.TCGETS
88

9-
func IsTerminal(fd int) bool {
9+
func isTerminal(fd int) bool {
1010
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
1111
return err == nil
1212
}

0 commit comments

Comments
 (0)