loop/staticaddr/log.go

35 lines
1.1 KiB
Go
Raw Normal View History

2023-11-09 19:16:31 +01:00
package staticaddr
import (
"github.com/btcsuite/btclog/v2"
2024-05-06 14:17:16 +02:00
"github.com/lightninglabs/loop/staticaddr/address"
"github.com/lightninglabs/loop/staticaddr/deposit"
2024-07-30 12:23:35 +02:00
"github.com/lightninglabs/loop/staticaddr/loopin"
2025-05-21 14:17:14 +02:00
"github.com/lightninglabs/loop/staticaddr/openchannel"
"github.com/lightninglabs/loop/staticaddr/withdraw"
2023-11-09 19:16:31 +01:00
"github.com/lightningnetwork/lnd/build"
)
// Subsystem defines the sub system name of this package.
const Subsystem = "SADDR"
// 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 log btclog.Logger
// The default amount of logging is none.
func init() {
UseLogger(build.NewSubLogger(Subsystem, nil))
}
// UseLogger uses a specified Logger to output package logging info. This should
// be used in preference to SetLogWriter if the caller is also using btclog.
func UseLogger(logger btclog.Logger) {
log = logger
2024-05-06 14:17:16 +02:00
address.UseLogger(log)
deposit.UseLogger(log)
withdraw.UseLogger(log)
2024-07-30 12:23:35 +02:00
loopin.UseLogger(log)
2025-05-21 14:17:14 +02:00
openchannel.UseLogger(log)
2024-03-07 17:27:33 +01:00
}