multi: optimize loggings around changes from blockbeat

This commit is contained in:
yyforyongyu committed 2024-12-20 17:54:08 +08:00
1 parent fecd5ac735
commit 4806b2fda7
9 files changed
+62 -38

No files matched your search

+12 -1
View File
@@ -1,6 +1,10 @@
package lnutils
import "github.com/davecgh/go-spew/spew"
import (
"strings"
"github.com/davecgh/go-spew/spew"
)
// LogClosure is used to provide a closure over expensive logging operations so
// don't have to be performed when the logging level doesn't warrant it.
@@ -25,3 +29,10 @@ func SpewLogClosure(a any) LogClosure {
return spew.Sdump(a)
}
}
// NewSeparatorClosure returns a new closure that logs a separator line.
func NewSeparatorClosure() LogClosure {
return func() string {
return strings.Repeat("=", 80)
}
}