responses to review comments

- empty string as marker for failure to discover calling function
 - tighten up logger usage - don't rely on std logger internally

Also fix ordering of expected/got in logrus_test.go to ensure correct
output form test failures.
This commit is contained in:
Dave Clendenan
2016-11-30 14:07:10 -08:00
parent 4575b7a64d
commit a5c845c224
7 changed files with 63 additions and 53 deletions
+3 -3
View File
@@ -31,7 +31,7 @@ type Formatter interface {
//
// It's not exported because it's still using Data in an opinionated way. It's to
// avoid code duplication between the two default formatters.
func prefixFieldClashes(data Fields) {
func prefixFieldClashes(data Fields, reportCaller bool) {
if t, ok := data["time"]; ok {
data["fields.time"] = t
}
@@ -44,8 +44,8 @@ func prefixFieldClashes(data Fields) {
data["fields.level"] = l
}
// If Reportmethod is not set, 'method' will not conflict.
if ReportCaller() {
// If reportCaller is not set, 'method' will not conflict.
if reportCaller {
if l, ok := data["method"]; ok {
data["fields.method"] = l
}