mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 14:22:37 +01:00
build: extract File logging options into own struct
In preparation for extending LoggerConfig with file specific config.
This commit is contained in:
parent
0512357c17
commit
1886d3865b
1 changed files with 10 additions and 3 deletions
|
@ -13,7 +13,7 @@ const (
|
|||
//nolint:lll
|
||||
type LogConfig struct {
|
||||
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.
|
||||
|
@ -29,8 +29,10 @@ type LoggerConfig struct {
|
|||
func DefaultLogConfig() *LogConfig {
|
||||
return &LogConfig{
|
||||
Console: defaultConsoleLoggerCfg(),
|
||||
File: &LoggerConfig{
|
||||
CallSite: callSiteOff,
|
||||
File: &FileLoggerConfig{
|
||||
LoggerConfig: LoggerConfig{
|
||||
CallSite: callSiteOff,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -59,3 +61,8 @@ func (cfg *LoggerConfig) HandlerOptions() []btclog.HandlerOption {
|
|||
|
||||
return opts
|
||||
}
|
||||
|
||||
// FileLoggerConfig extends LoggerConfig with specific log file options.
|
||||
type FileLoggerConfig struct {
|
||||
LoggerConfig
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue