2019-03-07 02:22:46 +00:00
|
|
|
package loop
|
|
|
|
|
|
|
|
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 (
|
2019-10-07 15:29:24 +00:00
|
|
|
backendLog = btclog.NewBackend(logWriter{})
|
|
|
|
logger = backendLog.Logger("CLIENT")
|
2019-03-07 02:22:46 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// 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
|
|
|
|
}
|