mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-06 09:34:13 +02:00
config: only create a sub-log manager if one doesnt already exist
The ValidateConfig method needs to account for the caller already having an initialised build.SubLoggerManager and then should not override it.
This commit is contained in:
12
config.go
12
config.go
@@ -1416,9 +1416,15 @@ func ValidateConfig(cfg Config, interceptor signal.Interceptor, fileParser,
|
||||
return nil, mkErr("error validating logging config: %w", err)
|
||||
}
|
||||
|
||||
cfg.SubLogMgr = build.NewSubLoggerManager(build.NewDefaultLogHandlers(
|
||||
cfg.LogConfig, cfg.LogRotator,
|
||||
)...)
|
||||
// If a sub-log manager was not already created, then we'll create one
|
||||
// now using the default log handlers.
|
||||
if cfg.SubLogMgr == nil {
|
||||
cfg.SubLogMgr = build.NewSubLoggerManager(
|
||||
build.NewDefaultLogHandlers(
|
||||
cfg.LogConfig, cfg.LogRotator,
|
||||
)...,
|
||||
)
|
||||
}
|
||||
|
||||
// Initialize logging at the default logging level.
|
||||
SetupLoggers(cfg.SubLogMgr, interceptor)
|
||||
|
Reference in New Issue
Block a user