multi: optimize loggings around changes from blockbeat

This commit is contained in:
yyforyongyu
2024-10-18 05:35:00 +08:00
parent fecd5ac735
commit 4806b2fda7
9 changed files with 62 additions and 38 deletions

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)
}
}