routing+htlcswitch+discovery+peer+netann: optimize debug logging with lazy evaluation

In this commit, we update the network and routing layer components to use
lnutils.SpewLogClosure for debug logging.
This commit is contained in:
Olaoluwa Osuntokun committed 2025-09-05 18:20:51 -07:00
1 parent 77f2d8a572
commit 2cc4079a0e
6 files changed
+15 -19

No files matched your search

+2 -3
View File
@@ -19,7 +19,6 @@ import (
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btclog/v2"
"github.com/davecgh/go-spew/spew"
"github.com/lightningnetwork/lnd/buffer"
"github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/channeldb"
@@ -1230,7 +1229,7 @@ func (p *Brontide) loadActiveChannels(chans []*channeldb.OpenChannel) (
}
p.log.Tracef("Using link policy of: %v",
spew.Sdump(forwardingPolicy))
lnutils.SpewLogClosure(forwardingPolicy))
// If the channel is pending, set the value to nil in the
// activeChannels map. This is done to signify that the channel
@@ -2839,7 +2838,7 @@ func (p *Brontide) queue(priority bool, msg lnwire.Message,
case p.outgoingQueue <- outgoingMsg{priority, msg, errChan}:
case <-p.cg.Done():
p.log.Tracef("Peer shutting down, could not enqueue msg: %v.",
spew.Sdump(msg))
lnutils.SpewLogClosure(msg))
if errChan != nil {
errChan <- lnpeer.ErrPeerExiting
}