Reduce spurious error/warn messages, if loglevel != debug

This commit is contained in:
Deluan
2022-11-03 12:38:05 -04:00
parent 80b7311453
commit 8f02daf337
2 changed files with 10 additions and 5 deletions
+3 -1
View File
@@ -195,7 +195,9 @@ func h(r chi.Router, path string, f handler) {
return
}
if r.Context().Err() != nil {
log.Warn("Request was interrupted", "path", path, r.Context().Err())
if log.CurrentLevel() >= log.LevelDebug {
log.Warn("Request was interrupted", "path", path, r.Context().Err())
}
return
}
if res != nil {