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

accept @JessonChan suggestion

This commit is contained in:
youngsterxyf 2016-01-25 20:53:25 +08:00
parent 0e17e2a3d2
commit bcac4bb8e3
3 changed files with 3 additions and 8 deletions

View File

@ -64,8 +64,7 @@ func (c *connWriter) WriteMsg(when time.Time, msg string, level int) error {
defer c.innerWriter.Close()
}
logTimeStr := formatLogTime(when)
msg = logTimeStr + msg
msg = formatLogTime(when) + msg
c.lg.Println(msg)
return nil

View File

@ -74,10 +74,7 @@ func (c *consoleWriter) WriteMsg(when time.Time, msg string, level int) error {
if level > c.Level {
return nil
}
logTimeStr := formatLogTime(when)
msg = logTimeStr + msg
msg = formatLogTime(when) + msg
if goos := runtime.GOOS; goos == "windows" {
c.lg.Println(msg)
return nil

View File

@ -121,8 +121,7 @@ func (w *fileLogWriter) WriteMsg(when time.Time, msg string, level int) error {
//2016/01/12 21:34:33
// now := time.Now()
d := when.Day()
logTimeStr := formatLogTime(when)
msg = logTimeStr + msg + "\n"
msg = formatLogTime(when) + msg + "\n"
if w.Rotate {
if w.needRotate(len(msg), d) {