2
0
mirror of https://github.com/lightninglabs/loop synced 2024-11-16 00:12:52 +00:00
loop/loopdb/log.go

22 lines
412 B
Go
Raw Normal View History

package loopdb
import (
"os"
"github.com/btcsuite/btclog"
)
var (
backendLog = btclog.NewBackend(logWriter{})
log = backendLog.Logger("STORE")
)
// 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
}