rpc: use existing rpc logger for wtclientrpc
The logger string used to identify the wtclient and wtclientrpc loggers was the same, leading to being unable to modify the log level of the wtclient logger as it would be overwritten with the wtclientrpc's one. To simplify things, we decide to use the existing RPC logger for wtclientrpc.
This commit is contained in:
6 files changed
+13
-53
No files matched your search
@@ -5,6 +5,7 @@ import (
|
||||
"reflect"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/btcsuite/btclog"
|
||||
"github.com/lightningnetwork/lnd/autopilot"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/htlcswitch"
|
||||
@@ -94,7 +95,8 @@ func (s *subRPCServerConfigs) PopulateDependencies(cc *chainControl,
|
||||
tower *watchtower.Standalone,
|
||||
towerClient wtclient.Client,
|
||||
tcpResolver lncfg.TCPResolver,
|
||||
genInvoiceFeatures func() *lnwire.FeatureVector) error {
|
||||
genInvoiceFeatures func() *lnwire.FeatureVector,
|
||||
rpcLogger btclog.Logger) error {
|
||||
|
||||
// First, we'll use reflect to obtain a version of the config struct
|
||||
// that allows us to programmatically inspect its fields.
|
||||
@@ -244,6 +246,9 @@ func (s *subRPCServerConfigs) PopulateDependencies(cc *chainControl,
|
||||
subCfgValue.FieldByName("Resolver").Set(
|
||||
reflect.ValueOf(tcpResolver),
|
||||
)
|
||||
subCfgValue.FieldByName("Log").Set(
|
||||
reflect.ValueOf(rpcLogger),
|
||||
)
|
||||
|
||||
default:
|
||||
return fmt.Errorf("unknown field: %v, %T", fieldName,
|
||||
|
||||
Reference in new issue
Block a user