(minor) unify log keys

This commit is contained in:
Lawrence, Rendall
2024-03-12 15:29:58 +03:00
parent cd5c65e0ef
commit 1a243b94c5
11 changed files with 25 additions and 20 deletions
+3 -2
View File
@@ -82,6 +82,7 @@ func build(config conf.MapConfig, _ storage.PeerStorage) (h middleware.Hook, err
cfg.Header = authorizationHeader
logger.Warn().
Str("name", "Header").
Str("provided", "").
Str("default", cfg.Header).
Msg("falling back to default configuration")
}
@@ -149,7 +150,7 @@ func (h *hook) HandleAnnounce(ctx context.Context, req *bittorrent.AnnounceReque
logger.Info().
Stringer("claimInfoHash", claimIH).
Stringer("requestInfoHash", req.InfoHash).
Object("peer", req.RequestPeer).
Object("source", req.RequestPeer).
Msg("unequal 'infohash' claim when validating JWT")
err = ErrInvalidJWT
}
@@ -220,7 +221,7 @@ func (h *hook) HandleScrape(ctx context.Context, req *bittorrent.ScrapeRequest,
} else {
logger.Info().
Err(jwtErr).
Array("source", &req.RequestAddresses).
Array("addresses", &req.RequestAddresses).
Msg("JWT validation failed")
err = ErrInvalidJWT
}