2019-03-06 20:13:50 +00:00
|
|
|
package test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
2019-10-07 15:29:24 +00:00
|
|
|
|
|
|
|
"github.com/btcsuite/btclog"
|
2019-03-06 20:13:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// 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{}
|
|
|
|
|
2023-09-28 11:16:01 +00:00
|
|
|
func (logWriter) Write(p []byte) (int, error) {
|
2019-03-06 20:13:50 +00:00
|
|
|
os.Stdout.Write(p)
|
|
|
|
return len(p), nil
|
|
|
|
}
|