mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
Previous code in log.go assumed there would by sub system level enable/disable for loop. This is not yet in place, so converting to same style as used in the lndclient package.
21 lines
412 B
Go
21 lines
412 B
Go
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
|
|
}
|