Skip to content

Commit fc0587c

Browse files
author
Dean Karn
authored
Fix terminal detection (#32)
Change from syscall.Stdout to os.Stdout.Fd().
1 parent d70d76e commit fc0587c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## log
2-
<img align="right" src="https://raw.githubusercontent.com/go-playground/log/master/logo.png">![Project status](https://img.shields.io/badge/version-7.0.0-green.svg)
2+
<img align="right" src="https://raw.githubusercontent.com/go-playground/log/master/logo.png">![Project status](https://img.shields.io/badge/version-7.0.1-green.svg)
33
[![Build Status](https://travis-ci.org/go-playground/log.svg?branch=master)](https://travis-ci.org/go-playground/log)
44
[![Coverage Status](https://coveralls.io/repos/github/go-playground/log/badge.svg?branch=master)](https://coveralls.io/github/go-playground/log?branch=master)
55
[![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/log)](https://goreportcard.com/report/github.com/go-playground/log)

log.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"os"
66
"sync"
7-
"syscall"
87
"time"
98

109
"golang.org/x/crypto/ssh/terminal"
@@ -21,7 +20,7 @@ var (
2120
)
2221

2322
func init() {
24-
if terminal.IsTerminal(syscall.Stdout) {
23+
if terminal.IsTerminal(int(os.Stdout.Fd())) {
2524
defaultHandler = newDefaultLogger()
2625
AddHandler(defaultHandler, AllLevels...)
2726
defaultHandlerRegistered = true

0 commit comments

Comments
 (0)