From 18fad4b3c057d7ef698560a054c4c29ece7fe3b6 Mon Sep 17 00:00:00 2001 From: Turing Zhu Date: Thu, 20 Jun 2019 13:49:56 +0800 Subject: [PATCH] fix fileVal check --- json_formatter.go | 2 +- text_formatter.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/json_formatter.go b/json_formatter.go index 098a21a..b951c89 100644 --- a/json_formatter.go +++ b/json_formatter.go @@ -97,7 +97,7 @@ func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { if funcVal != "" { data[f.FieldMap.resolve(FieldKeyFunc)] = funcVal } - if fileVal != "" { + if fileVal != ":0" { data[f.FieldMap.resolve(FieldKeyFile)] = fileVal } } diff --git a/text_formatter.go b/text_formatter.go index e01587c..5460200 100644 --- a/text_formatter.go +++ b/text_formatter.go @@ -139,7 +139,7 @@ func (f *TextFormatter) Format(entry *Entry) ([]byte, error) { if funcVal != "" { fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyFunc)) } - if fileVal != "" { + if fileVal != ":0" { fixedKeys = append(fixedKeys, f.FieldMap.resolve(FieldKeyFile)) } }