Files
aperture/internal/test/log.go
Oliver Gugger 3b73ac96cb mod+lsat+test: copy test code to get rid of loop
To get rid of the loop dependency, we copy the test code that we rely on
and fix some imports.
2020-08-11 10:03:34 +02:00

25 lines
572 B
Go

package test
import (
"os"
"github.com/btcsuite/btclog"
)
// 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.NewBackend(logWriter{})
logger = backendLog.Logger("TEST")
)
// 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
}