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
@@ -15,7 +15,6 @@ import (
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/davecgh/go-spew/spew"
"github.com/lightninglabs/neutrino/cache"
"github.com/lightninglabs/neutrino/cache/lru"
"github.com/lightningnetwork/lnd/batch"
@@ -1650,7 +1649,7 @@ func (d *AuthenticatedGossiper) handleNetworkMessages(ctx context.Context,
if err != nil {
// Something is wrong if SignalDependents returns an error.
log.Errorf("SignalDependents returned error for msg=%v with "+
"JobID=%v", spew.Sdump(nMsg.msg), jobID)
"JobID=%v", lnutils.SpewLogClosure(nMsg.msg), jobID)
nMsg.err <- err
@@ -3196,7 +3195,7 @@ func (d *AuthenticatedGossiper) handleChanUpdate(ctx context.Context,
if err != nil {
rErr := fmt.Errorf("unable to validate channel update "+
"announcement for short_chan_id=%v: %v",
spew.Sdump(upd.ShortChannelID), err)
lnutils.SpewLogClosure(upd.ShortChannelID), err)
log.Error(rErr)
nMsg.err <- rErr