mirror of https://github.com/sirupsen/logrus.git
use buffer length to avoid generating strings every time
This commit is contained in:
parent
3eef8ce63d
commit
211aba39c8
|
@ -154,7 +154,7 @@ func (f *TextFormatter) needsQuoting(text string) bool {
|
|||
}
|
||||
|
||||
func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}) {
|
||||
if b.String() != "" {
|
||||
if b.Len() > 0 {
|
||||
b.WriteByte(' ')
|
||||
}
|
||||
b.WriteString(key)
|
||||
|
|
Loading…
Reference in New Issue