mirror of
https://github.com/navidrome/navidrome.git
synced 2025-06-07 02:43:17 +03:00
Reduce spurious error/warn messages, if loglevel != debug
This commit is contained in:
parent
80b7311453
commit
8f02daf337
@ -195,7 +195,9 @@ func h(r chi.Router, path string, f handler) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if r.Context().Err() != nil {
|
if r.Context().Err() != nil {
|
||||||
|
if log.CurrentLevel() >= log.LevelDebug {
|
||||||
log.Warn("Request was interrupted", "path", path, r.Context().Err())
|
log.Warn("Request was interrupted", "path", path, r.Context().Err())
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if res != nil {
|
if res != nil {
|
||||||
|
@ -68,13 +68,16 @@ func (c *StreamController) Stream(w http.ResponseWriter, r *http.Request) (*resp
|
|||||||
if r.Method == "HEAD" {
|
if r.Method == "HEAD" {
|
||||||
go func() { _, _ = io.Copy(io.Discard, stream) }()
|
go func() { _, _ = io.Copy(io.Discard, stream) }()
|
||||||
} else {
|
} else {
|
||||||
if c, err := io.Copy(w, stream); err != nil {
|
c, err := io.Copy(w, stream)
|
||||||
|
if log.CurrentLevel() >= log.LevelDebug {
|
||||||
|
if err != nil {
|
||||||
log.Error(ctx, "Error sending transcoded file", "id", id, err)
|
log.Error(ctx, "Error sending transcoded file", "id", id, err)
|
||||||
} else {
|
} else {
|
||||||
log.Trace(ctx, "Success sending transcode file", "id", id, "size", c)
|
log.Trace(ctx, "Success sending transcode file", "id", id, "size", c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user