]> Sergey Matveev's repositories - btrtrc.git/blobdiff - client.go
Set torrent logger default level to debug
[btrtrc.git] / client.go
index c2e01ee56ace962f1815859a69414bd082ab1414..4fac27220f10c302ec2271e4580448a298522f4f 100644 (file)
--- a/client.go
+++ b/client.go
@@ -783,7 +783,7 @@ func (cl *Client) establishOutgoingConnEx(
                return nil, err
        }
        if err != nil {
-               log.Print(err)
+               t.logger.Print(err)
        }
        dialCtx, cancel := context.WithTimeout(context.Background(), func() time.Duration {
                cl.rLock()
@@ -1294,7 +1294,7 @@ func (cl *Client) newTorrentOpt(opts AddTorrentOpts) (t *Torrent) {
        t.smartBanCache.Hash = sha1.Sum
        t.smartBanCache.Init()
        t.networkingEnabled.Set()
-       t.logger = cl.logger.WithContextValue(t).WithNames("torrent", t.infoHash.HexString())
+       t.logger = cl.logger.WithContextValue(t).WithNames("torrent", t.infoHash.HexString()).WithDefaultLevel(log.Debug)
        t.sourcesLogger = t.logger.WithNames("sources")
        if opts.ChunkSize == 0 {
                opts.ChunkSize = defaultChunkSize