doc updates, and relabel ReportMethod

in the Logrus context it's the caller, so use that internally.  Label
stays as 'method' since in the context of the log event that seems more
correct.
This commit is contained in:
Dave Clendenan
2016-11-29 09:35:34 -08:00
parent 1e21450408
commit 348bace269
9 changed files with 37 additions and 39 deletions
+3 -3
View File
@@ -46,7 +46,7 @@ type Entry struct {
Level Level
// Calling method, with package name
Method string
Caller string
// Message passed to Debug, Info, Warn, Error, Fatal or Panic
Message string
@@ -135,8 +135,8 @@ func (entry Entry) log(level Level, msg string) {
entry.Time = time.Now()
entry.Level = level
entry.Message = msg
if ReportMethod() {
entry.Method = getCaller()
if ReportCaller() {
entry.Caller = getCaller()
}
if err := entry.Logger.Hooks.Fire(level, &entry); err != nil {
entry.Logger.mu.Lock()