File tree Expand file tree Collapse file tree 4 files changed +35
-27
lines changed Expand file tree Collapse file tree 4 files changed +35
-27
lines changed Original file line number Diff line number Diff line change 11language : go
22go :
3- - 1.5.2
3+ - 1.6
4+ - 1.7
45 - tip
56before_install :
67 - go get github.com/modocache/gover
@@ -11,5 +12,9 @@ script:
1112 - go test -coverprofile=color.coverprofile ./color
1213 - go test -coverprofile=bytes.coverprofile ./bytes
1314 - go test -coverprofile=log.coverprofile ./log
15+ - go test -coverprofile=random.coverprofile ./random
1416 - $HOME/gopath/bin/gover
1517 - $HOME/gopath/bin/goveralls -coverprofile=gover.coverprofile -service=travis-ci
18+ matrix :
19+ allow_failures :
20+ - go : tip
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import (
1313
1414 "strconv"
1515
16- "github.com/mattn/go-colorable"
1716 "github.com/mattn/go-isatty"
1817 "github.com/valyala/fasttemplate"
1918
@@ -65,7 +64,7 @@ func New(prefix string) (l *Logger) {
6564 },
6665 }
6766 l .initLevels ()
68- l .SetOutput (colorable . NewColorableStdout ())
67+ l .SetOutput (output ())
6968 return
7069}
7170
@@ -113,17 +112,21 @@ func (l *Logger) Output() io.Writer {
113112 return l .output
114113}
115114
116- func (l * Logger ) SetHeader (h string ) {
117- l .template = l .newTemplate (h )
118- }
119-
120115func (l * Logger ) SetOutput (w io.Writer ) {
121116 l .output = w
122117 if w , ok := w .(* os.File ); ! ok || ! isatty .IsTerminal (w .Fd ()) {
123118 l .DisableColor ()
124119 }
125120}
126121
122+ func (l * Logger ) Color () * color.Color {
123+ return l .color
124+ }
125+
126+ func (l * Logger ) SetHeader (h string ) {
127+ l .template = l .newTemplate (h )
128+ }
129+
127130func (l * Logger ) Print (i ... interface {}) {
128131 fmt .Fprintln (l .output , i ... )
129132}
Original file line number Diff line number Diff line change 22
33package log
44
5- import "io"
5+ import (
6+ "io"
7+ "os"
8+ )
69
710func output () io.Writer {
8- return os .stdout
11+ return os .Stdout
912}
You can’t perform that action at this time.
0 commit comments