mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
config: register subserver loggers before validation
Ensure that all of Lit's subserver loggers have been registered _before_ the config is validated. This will allow users to use the `--lnd.debuglevel` flag to set Lit specific subserever logger levels.
This commit is contained in:
parent
06bb73f62d
commit
daab70c040
1 changed files with 6 additions and 4 deletions
10
config.go
10
config.go
|
|
@ -328,6 +328,12 @@ func loadAndValidateConfig(interceptor signal.Interceptor) (*Config, error) {
|
|||
os.Exit(0)
|
||||
}
|
||||
|
||||
// Before we validate the config, we first hook up our own loggers.
|
||||
// This must be done before the config is validated if LND is running
|
||||
// in integrated mode so that the log levels for various non-LND related
|
||||
// subsystems can be set via the `lnd.debuglevel` flag.
|
||||
SetupLoggers(preCfg.Lnd.LogWriter, interceptor)
|
||||
|
||||
// Load the main configuration file and parse any command line options.
|
||||
// This function will also set up logging properly.
|
||||
cfg, err := loadConfigFile(preCfg, interceptor)
|
||||
|
|
@ -335,10 +341,6 @@ func loadAndValidateConfig(interceptor signal.Interceptor) (*Config, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// With the validated config obtained, we now know that the root logging
|
||||
// system of lnd is initialized and we can hook up our own loggers now.
|
||||
SetupLoggers(cfg.Lnd.LogWriter, interceptor)
|
||||
|
||||
// Translate the more user friendly string modes into the more developer
|
||||
// friendly internal bool variables now.
|
||||
cfg.lndRemote = cfg.LndMode == ModeRemote
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue