Skip to content

Commit

Permalink
proper colors on windows thanks to mattn. fixes inconshreveable#13
Browse files Browse the repository at this point in the history
  • Loading branch information
inconshreveable committed Nov 5, 2014
1 parent dd1a0f2 commit 4ce6c38
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"os"

"github.com/inconshreveable/log15/term"
"github.com/mattn/go-colorable"
)

var (
Expand All @@ -14,11 +15,11 @@ var (

func init() {
if term.IsTty(os.Stdout.Fd()) {
StdoutHandler = StreamHandler(os.Stdout, TerminalFormat())
StdoutHandler = StreamHandler(colorable.NewColorableStdout(), TerminalFormat())
}

if term.IsTty(os.Stderr.Fd()) {
StderrHandler = StreamHandler(os.Stderr, TerminalFormat())
StderrHandler = StreamHandler(colorable.NewColorableStderr(), TerminalFormat())
}

root = &logger{[]interface{}{}, new(swapHandler)}
Expand Down

0 comments on commit 4ce6c38

Please sign in to comment.