fixed bug: in logs package check if platform is windows
Showing
1 changed file
with
5 additions
and
0 deletions
| ... | @@ -4,6 +4,7 @@ import ( | ... | @@ -4,6 +4,7 @@ import ( |
| 4 | "encoding/json" | 4 | "encoding/json" |
| 5 | "log" | 5 | "log" |
| 6 | "os" | 6 | "os" |
| 7 | "runtime" | ||
| 7 | ) | 8 | ) |
| 8 | 9 | ||
| 9 | type Brush func(string) string | 10 | type Brush func(string) string |
| ... | @@ -54,7 +55,11 @@ func (c *ConsoleWriter) WriteMsg(msg string, level int) error { | ... | @@ -54,7 +55,11 @@ func (c *ConsoleWriter) WriteMsg(msg string, level int) error { |
| 54 | if level < c.Level { | 55 | if level < c.Level { |
| 55 | return nil | 56 | return nil |
| 56 | } | 57 | } |
| 58 | if goos := runtime.GOOS; goos == "windows" { | ||
| 59 | c.lg.Println(msg) | ||
| 60 | } else { | ||
| 57 | c.lg.Println(colors[level](msg)) | 61 | c.lg.Println(colors[level](msg)) |
| 62 | } | ||
| 58 | return nil | 63 | return nil |
| 59 | } | 64 | } |
| 60 | 65 | ... | ... |
-
Please register or sign in to post a comment