2019-03-07 02:19:57 +00:00
|
|
|
package loopdb
|
|
|
|
|
|
|
|
import (
|
2019-05-20 10:22:31 +00:00
|
|
|
"os"
|
|
|
|
|
2019-03-07 02:19:57 +00:00
|
|
|
"github.com/btcsuite/btclog"
|
|
|
|
)
|
|
|
|
|
2019-05-20 10:22:31 +00:00
|
|
|
var (
|
|
|
|
backendLog = btclog.NewBackend(logWriter{})
|
|
|
|
log = backendLog.Logger("STORE")
|
|
|
|
)
|
2019-03-07 02:19:57 +00:00
|
|
|
|
2019-05-20 10:22:31 +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{}
|
2019-03-07 02:19:57 +00:00
|
|
|
|
2019-05-20 10:22:31 +00:00
|
|
|
func (logWriter) Write(p []byte) (n int, err error) {
|
|
|
|
os.Stdout.Write(p)
|
|
|
|
return len(p), nil
|
2019-03-07 02:19:57 +00:00
|
|
|
}
|