responses to code review

- field rename to be more properly generic
 - drop rewrite of main.main
This commit is contained in:
Dave Clendenan
2016-12-06 12:53:21 -08:00
parent d8fd23467c
commit 88dd8df1f8
7 changed files with 50 additions and 49 deletions
+7 -5
View File
@@ -1,6 +1,8 @@
package logrus
import "time"
import (
"time"
)
// DefaultTimestampFormat is YYYY-mm-DDTHH:MM:SS-TZ
const DefaultTimestampFormat = time.RFC3339
@@ -19,7 +21,7 @@ type Formatter interface {
Format(*Entry) ([]byte, error)
}
// This is to not silently overwrite `time`, `msg`, `method` and `level` fields when
// This is to not silently overwrite `time`, `msg`, `func` and `level` fields when
// dumping it. If this code wasn't there doing:
//
// logrus.WithField("level", 1).Info("hello")
@@ -44,10 +46,10 @@ func prefixFieldClashes(data Fields, reportCaller bool) {
data["fields.level"] = l
}
// If reportCaller is not set, 'method' will not conflict.
// If reportCaller is not set, 'func' will not conflict.
if reportCaller {
if l, ok := data["method"]; ok {
data["fields.method"] = l
if l, ok := data["func"]; ok {
data["fields.func"] = l
}
}
}