multi: add SpewLogClosure to avoid code repetition

This commit is contained in:
yyforyongyu
2024-07-25 22:18:00 +08:00
parent b6049ff94b
commit d992cf94d6
19 changed files with 57 additions and 144 deletions

View File

@@ -2184,9 +2184,7 @@ func (p *Brontide) logWireMessage(msg lnwire.Message, read bool) {
prefix = "writeMessage to peer"
}
p.log.Tracef(prefix+": %v", lnutils.NewLogClosure(func() string {
return spew.Sdump(msg)
}))
p.log.Tracef(prefix+": %v", lnutils.SpewLogClosure(msg))
}
// writeMessage writes and flushes the target lnwire.Message to the remote peer.