Merge branch 'moriyoshi/refix-707' of git://github.com/moriyoshi/logrus into fix_firehooks

This commit is contained in:
David Bariod
2018-07-21 09:00:01 +02:00
2 changed files with 8 additions and 13 deletions
+2 -4
View File
@@ -127,12 +127,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)
}