Skip to content

Commit

Permalink
Fix terminal detection (#32)
Browse files Browse the repository at this point in the history
Change from syscall.Stdout to os.Stdout.Fd().
  • Loading branch information
Dean Karn authored May 21, 2019
1 parent d70d76e commit fc0587c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## log
<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)
<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)
[![Build Status](https://travis-ci.org/go-playground/log.svg?branch=master)](https://travis-ci.org/go-playground/log)
[![Coverage Status](https://coveralls.io/repos/github/go-playground/log/badge.svg?branch=master)](https://coveralls.io/github/go-playground/log?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/log)](https://goreportcard.com/report/github.com/go-playground/log)
Expand Down
3 changes: 1 addition & 2 deletions log.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"os"
"sync"
"syscall"
"time"

"golang.org/x/crypto/ssh/terminal"
Expand All @@ -21,7 +20,7 @@ var (
)

func init() {
if terminal.IsTerminal(syscall.Stdout) {
if terminal.IsTerminal(int(os.Stdout.Fd())) {
defaultHandler = newDefaultLogger()
AddHandler(defaultHandler, AllLevels...)
defaultHandlerRegistered = true
Expand Down

0 comments on commit fc0587c

Please sign in to comment.