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