File tree Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ require (
11
11
github.com/docker/go-units v0.4.0
12
12
github.com/inconshreveable/mousetrap v1.0.0 // indirect
13
13
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0
14
+ github.com/mattn/go-colorable v0.0.9
14
15
github.com/pborman/uuid v1.2.0
15
16
github.com/pkg/errors v0.8.1
16
17
github.com/sirupsen/logrus v1.4.1
Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ package logging
3
3
import (
4
4
"io"
5
5
"os"
6
+ "runtime"
6
7
8
+ "github.com/mattn/go-colorable"
7
9
"github.com/sirupsen/logrus"
8
10
)
9
11
@@ -15,6 +17,14 @@ type stdErrHook struct {
15
17
}
16
18
17
19
func newstdErrHook (level logrus.Level , formatter logrus.Formatter ) * stdErrHook {
20
+ // For windows to display colors we need to use the go-colorable writer
21
+ if runtime .GOOS == "windows" {
22
+ return & stdErrHook {
23
+ stderr : colorable .NewColorableStderr (),
24
+ formatter : formatter ,
25
+ level : level ,
26
+ }
27
+ }
18
28
return & stdErrHook {
19
29
stderr : os .Stderr ,
20
30
formatter : formatter ,
Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ package logging
3
3
import (
4
4
"io"
5
5
"os"
6
+ "runtime"
6
7
8
+ "github.com/mattn/go-colorable"
7
9
"github.com/sirupsen/logrus"
8
10
)
9
11
@@ -15,6 +17,14 @@ type stdOutHook struct {
15
17
}
16
18
17
19
func newstdOutHook (level logrus.Level , formatter logrus.Formatter ) * stdOutHook {
20
+ // For windows to display colors we need to use the go-colorable writer
21
+ if runtime .GOOS == "windows" {
22
+ return & stdOutHook {
23
+ stdout : colorable .NewColorableStdout (),
24
+ formatter : formatter ,
25
+ level : level ,
26
+ }
27
+ }
18
28
return & stdOutHook {
19
29
stdout : os .Stdout ,
20
30
formatter : formatter ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ github.com/code-ready/clicumber/testsuite
11
11
github.com/code-ready/clicumber/util
12
12
# github.com/code-ready/goodhosts v0.0.0-20190712111040-f090f3f77c26
13
13
github.com/code-ready/goodhosts
14
+ # github.com/code-ready/machine v0.0.0-20190731093717-b6d974ad44d0
14
15
github.com/code-ready/machine/libmachine/state
15
16
github.com/code-ready/machine/libmachine/drivers
16
17
github.com/code-ready/machine/libmachine
You can’t perform that action at this time.
0 commit comments