multi: add NewLogClosure in lnutils to avoid repetition

And replaces all usage of `logClosure` with `lnutils.LogClosure`.
This commit is contained in:
yyforyongyu committed 2024-07-25 21:25:23 +08:00
1 parent 7e60d41898
commit b6049ff94b
38 files changed
+103 -299

No files matched your search

+2 -2
View File
@@ -2156,7 +2156,7 @@ func (p *Brontide) logWireMessage(msg lnwire.Message, read bool) {
summaryPrefix = "Sending"
}
p.log.Debugf("%v", newLogClosure(func() string {
p.log.Debugf("%v", lnutils.NewLogClosure(func() string {
// Debug summary of message.
summary := messageSummary(msg)
if len(summary) > 0 {
@@ -2184,7 +2184,7 @@ func (p *Brontide) logWireMessage(msg lnwire.Message, read bool) {
prefix = "writeMessage to peer"
}
p.log.Tracef(prefix+": %v", newLogClosure(func() string {
p.log.Tracef(prefix+": %v", lnutils.NewLogClosure(func() string {
return spew.Sdump(msg)
}))
}