go.mod+build: update btclog dep

This commit is contained in:
Elle Mouton
2024-11-25 12:05:44 +02:00
parent c8cfa59316
commit b98fc168ec
5 changed files with 33 additions and 8 deletions

View File

@ -108,6 +108,19 @@ func (h *handlerSet) Level() btclogv1.Level {
return h.level
}
// WithPrefix returns a copy of the Handler but with the given string prefixed
// to each log message.
//
// NOTE: this is part of the btclog.Handler interface.
func (h *handlerSet) WithPrefix(prefix string) btclog.Handler {
newSet := &handlerSet{set: make([]btclog.Handler, len(h.set))}
for i, handler := range h.set {
newSet.set[i] = handler.WithPrefix(prefix)
}
return newSet
}
// A compile-time check to ensure that handlerSet implements btclog.Handler.
var _ btclog.Handler = (*handlerSet)(nil)