1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 13:30:56 +00:00

fixed bug: in logs package check if platform is windows

This commit is contained in:
cloudaice 2014-01-28 11:26:43 +08:00
parent 9384e87083
commit d93f112083

View File

@ -4,6 +4,7 @@ import (
"encoding/json" "encoding/json"
"log" "log"
"os" "os"
"runtime"
) )
type Brush func(string) string type Brush func(string) string
@ -54,7 +55,11 @@ func (c *ConsoleWriter) WriteMsg(msg string, level int) error {
if level < c.Level { if level < c.Level {
return nil return nil
} }
c.lg.Println(colors[level](msg)) if goos := runtime.GOOS; goos == "windows" {
c.lg.Println(msg)
} else {
c.lg.Println(colors[level](msg))
}
return nil return nil
} }