1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 01:20:55 +00:00

Merge pull request #487 from cloudaice/log-feature

fixed bug: in logs package check if platform is windows
This commit is contained in:
astaxie 2014-01-27 20:50:25 -08:00
commit ab8f8d532a

View File

@ -4,6 +4,7 @@ import (
"encoding/json"
"log"
"os"
"runtime"
)
type Brush func(string) string
@ -54,7 +55,11 @@ func (c *ConsoleWriter) WriteMsg(msg string, level int) error {
if level < c.Level {
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
}