fix ReportCaller race condition

This commit is contained in:
georlav
2019-03-04 20:38:10 +02:00
parent c9b4f5af6d
commit b9d451406d
2 changed files with 19 additions and 0 deletions
+2
View File
@@ -206,7 +206,9 @@ func (entry Entry) log(level Level, msg string) {
entry.Level = level
entry.Message = msg
if entry.Logger.ReportCaller {
entry.Logger.mu.Lock()
entry.Caller = getCaller()
entry.Logger.mu.Unlock()
}
entry.fireHooks()