From 6ab4d18f231dfc5cc01f7e113e59a678a6536257 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 24 Apr 2025 23:06:15 +1000 Subject: [PATCH] Include torrent info hash as logger context text --- client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 34a51644..99266c50 100644 --- a/client.go +++ b/client.go @@ -1384,7 +1384,8 @@ func (cl *Client) newTorrentOpt(opts AddTorrentOpts) (t *Torrent) { } t.smartBanCache.Init() t.networkingEnabled.Set() - t.logger = cl.logger.WithDefaultLevel(log.Debug).WithNames(t.InfoHash().HexString()) + ihHex := t.InfoHash().HexString() + t.logger = cl.logger.WithDefaultLevel(log.Debug).WithNames(ihHex).WithContextText(ihHex) t.sourcesLogger = t.logger.WithNames("sources") if opts.ChunkSize == 0 { opts.ChunkSize = defaultChunkSize -- 2.48.1