cherry-pick: all: opt log levels

Updates #3929.

Squashed commit of the following:

commit bfb2361d81a0667c36193484ca125d08e5638b21
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Dec 24 17:23:39 2021 +0300

    all: opt log levels
This commit is contained in:
Ainar Garipov 2021-12-24 17:29:57 +03:00 committed by Ainar Garipov
parent 7528699fc2
commit 9f36e57c1e
1 changed files with 5 additions and 1 deletions

View File

@ -298,7 +298,11 @@ func shutdownSrv(ctx context.Context, srv *http.Server) {
err := srv.Shutdown(ctx)
if err != nil {
log.Error("error while shutting down http server %q: %s", srv.Addr, err)
if errors.Is(err, context.Canceled) {
log.Debug("shutting down http server %q: %s", srv.Addr, err)
} else {
log.Error("shutting down http server %q: %s", srv.Addr, err)
}
}
}