fix race condition caused by writing to entry.Data, using the same technique as JSONFormatter

This commit is contained in:
Hǎi-Liàng "Hal" Wáng
2018-11-05 12:29:28 +00:00
parent 44067abb19
commit 2cafb78db2
2 changed files with 13 additions and 10 deletions
+1 -1
View File
@@ -144,7 +144,7 @@ func TestDisableLevelTruncation(t *testing.T) {
tf := &TextFormatter{DisableLevelTruncation: disabled}
var b bytes.Buffer
entry.Level = level
tf.printColored(&b, entry, keys, timestampFormat)
tf.printColored(&b, entry, keys, nil, timestampFormat)
logLine := (&b).String()
if disabled {
expected := strings.ToUpper(level.String())