simplify hasCaller check

This commit is contained in:
Dave Clendenan
2016-11-30 15:15:38 -08:00
parent a5c845c224
commit 65f3af38f7
4 changed files with 15 additions and 24 deletions
+6
View File
@@ -126,6 +126,12 @@ func getCaller() (method string) {
return ""
}
func (entry Entry) HasCaller() (has bool) {
return entry.Logger != nil &&
entry.Logger.ReportCaller &&
entry.Caller != ""
}
// This function is not declared with a pointer value because otherwise
// race conditions will occur when using multiple goroutines
func (entry Entry) log(level Level, msg string) {