build: extract File logging options into own struct
In preparation for extending LoggerConfig with file specific config.
This commit is contained in:
1 file changed
+10
-3
+10
-3
@@ -13,7 +13,7 @@ const (
|
|||||||
//nolint:lll
|
//nolint:lll
|
||||||
type LogConfig struct {
|
type LogConfig struct {
|
||||||
Console *consoleLoggerCfg `group:"console" namespace:"console" description:"The logger writing to stdout and stderr."`
|
Console *consoleLoggerCfg `group:"console" namespace:"console" description:"The logger writing to stdout and stderr."`
|
||||||
File *LoggerConfig `group:"file" namespace:"file" description:"The logger writing to LND's standard log file."`
|
File *FileLoggerConfig `group:"file" namespace:"file" description:"The logger writing to LND's standard log file."`
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoggerConfig holds options for a particular logger.
|
// LoggerConfig holds options for a particular logger.
|
||||||
@@ -29,8 +29,10 @@ type LoggerConfig struct {
|
|||||||
func DefaultLogConfig() *LogConfig {
|
func DefaultLogConfig() *LogConfig {
|
||||||
return &LogConfig{
|
return &LogConfig{
|
||||||
Console: defaultConsoleLoggerCfg(),
|
Console: defaultConsoleLoggerCfg(),
|
||||||
File: &LoggerConfig{
|
File: &FileLoggerConfig{
|
||||||
CallSite: callSiteOff,
|
LoggerConfig: LoggerConfig{
|
||||||
|
CallSite: callSiteOff,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,3 +61,8 @@ func (cfg *LoggerConfig) HandlerOptions() []btclog.HandlerOption {
|
|||||||
|
|
||||||
return opts
|
return opts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FileLoggerConfig extends LoggerConfig with specific log file options.
|
||||||
|
type FileLoggerConfig struct {
|
||||||
|
LoggerConfig
|
||||||
|
}
|
||||||
Reference in new issue
Block a user