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
+2 -2
View File
@@ -123,7 +123,7 @@ func getCaller() (method string) {
}
// if we got here, we failed to find the caller's context
return "UNKNOWN_CALLER"
return ""
}
// This function is not declared with a pointer value because otherwise
@@ -133,7 +133,7 @@ func (entry Entry) log(level Level, msg string) {
entry.Time = time.Now()
entry.Level = level
entry.Message = msg
if ReportCaller() {
if entry.Logger.ReportCaller {
entry.Caller = getCaller()
}
if err := entry.Logger.Hooks.Fire(level, &entry); err != nil {