Revert the change introduced in #707 and do the proper fix. Fixes #729

This commit is contained in:
Moriyoshi Koizumi
2018-05-30 09:50:59 +00:00
parent ea8897e799
commit 070c81def3
2 changed files with 8 additions and 13 deletions
+2 -4
View File
@@ -113,12 +113,10 @@ func (entry Entry) log(level Level, msg string) {
}
}
// This function is not declared with a pointer value because otherwise
// race conditions will occur when using multiple goroutines
func (entry Entry) fireHooks() {
func (entry *Entry) fireHooks() {
entry.Logger.mu.Lock()
defer entry.Logger.mu.Unlock()
err := entry.Logger.Hooks.Fire(entry.Level, &entry)
err := entry.Logger.Hooks.Fire(entry.Level, entry)
if err != nil {
fmt.Fprintf(os.Stderr, "Failed to fire hook: %v\n", err)
}