Skip to content

Commit

Permalink
Merge pull request #1552 from revel/1542_recursive_call
Browse files Browse the repository at this point in the history
Fixed log recursive call
  • Loading branch information
brendensoares committed Apr 12, 2022
2 parents d202b93 + bc89379 commit bc0e27f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion logger/handlers.go
Expand Up @@ -50,7 +50,10 @@ func CallerFileHandler(h LogHandler) LogHandler {
// Adds in a context called `caller` to the record (contains file name and line number like `foo.go:12`)
// Uses the `log15.CallerFuncHandler` to perform this task.
func CallerFuncHandler(h LogHandler) LogHandler {
return CallerFuncHandler(h)
return FuncHandler(func(r *Record) error {
r.Context.Add("fn", fmt.Sprintf("%+n", r.Call))
return h.Log(r)
})
}

// Filters out records which match the key value pair
Expand Down

0 comments on commit bc0e27f

Please sign in to comment.