More linting

This commit is contained in:
Paul Tötterman
2021-02-10 16:34:20 +02:00
parent b562bd2dc5
commit ddec572d5d
29 changed files with 275 additions and 107 deletions

View File

@@ -50,6 +50,7 @@ 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 {
// TODO: infinite recursion
return CallerFuncHandler(h)
}
@@ -137,8 +138,9 @@ func NotMatchHandler(key string, value interface{}, h LogHandler) LogHandler {
func MultiHandler(hs ...LogHandler) LogHandler {
return FuncHandler(func(r *Record) error {
for _, h := range hs {
// what to do about failures?
h.Log(r)
if err := h.Log(r); err != nil {
panic(err)
}
}
return nil
})
@@ -189,6 +191,7 @@ func (ll *ListLogHandler) Log(r *Record) (err error) {
handler.Log(r)
}
}
return
}