mirror of
https://github.com/lightninglabs/loop
synced 2024-11-13 13:10:30 +00:00
24 lines
581 B
Go
24 lines
581 B
Go
package lndclient
|
|
|
|
import (
|
|
"github.com/btcsuite/btclog"
|
|
"os"
|
|
)
|
|
|
|
// 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("LNDCLIENT")
|
|
)
|
|
|
|
// 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
|
|
}
|