Files
aperture/internal/test/log.go
Elle Mouton 90941dc033 multi: update btclog, lnd and lndclient deps
Update the deps so that structured logging is available in aperture.
2025-03-05 11:12:29 +02:00

25 lines
604 B
Go

package test
import (
"os"
"github.com/btcsuite/btclog/v2"
)
// log is a logger that is initialized with no output filters. This
// means the package will not perform any logging by default until the caller
// requests it.
var (
backendLog = btclog.NewDefaultHandler(logWriter{}).SubSystem("TEST")
logger = btclog.NewSLogger(backendLog)
)
// logWriter implements an io.Writer that outputs to both standard output and
// the write-end pipe of an initialized log rotator.
type logWriter struct{}
func (logWriter) Write(p []byte) (n int, err error) {
os.Stdout.Write(p)
return len(p), nil
}