Have prefixFieldClashes respect the JSON FieldMap

Currently, it will fix clashes that don't exist and miss clashes that
do exist due to field remapping.

Fixes #708
This commit is contained in:
Lyra Naeseth
2018-02-13 17:44:51 -08:00
parent 8c0189d9f6
commit efab7f37b7
4 changed files with 68 additions and 9 deletions
+2 -1
View File
@@ -20,6 +20,7 @@ const (
var (
baseTimestamp time.Time
emptyFieldMap FieldMap
)
func init() {
@@ -82,7 +83,7 @@ func (f *TextFormatter) Format(entry *Entry) ([]byte, error) {
b = &bytes.Buffer{}
}
prefixFieldClashes(entry.Data)
prefixFieldClashes(entry.Data, emptyFieldMap)
f.Do(func() { f.init(entry) })