[fix bug]console more empty line
This commit is contained in:
parent
bf6dd440ec
commit
08cde0b55d
@ -62,7 +62,7 @@ func (c *consoleWriter) Format(lm *LogMsg) string {
|
||||
msg = strings.Replace(msg, levelPrefix[lm.Level], colors[lm.Level](levelPrefix[lm.Level]), 1)
|
||||
}
|
||||
h, _, _ := formatTimeHeader(lm.When)
|
||||
bytes := append(append(h, msg...), '\n')
|
||||
bytes := append(h, msg...)
|
||||
return string(bytes)
|
||||
}
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ func TestFormat(t *testing.T) {
|
||||
Prefix: "Cus",
|
||||
}
|
||||
res := log.Format(lm)
|
||||
assert.Equal(t, "2020/09/19 20:12:37.000 \x1b[1;44m[D]\x1b[0m Cus Hello, world\n", res)
|
||||
assert.Equal(t, "2020/09/19 20:12:37.000 \x1b[1;44m[D]\x1b[0m Cus Hello, world", res)
|
||||
err := log.WriteMsg(lm)
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user