Skip to content

Commit 9feb761

Browse files
authored
Merge pull request #9576 from ellemouton/logConfYamlTags
build: add yaml tags to some LogConfig fields
2 parents f744a54 + 1dec8ab commit 9feb761

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

build/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func DefaultLogConfig() *LogConfig {
5757
Compressor: defaultLogCompressor,
5858
MaxLogFiles: DefaultMaxLogFiles,
5959
MaxLogFileSize: DefaultMaxLogFileSize,
60-
LoggerConfig: LoggerConfig{
60+
LoggerConfig: &LoggerConfig{
6161
CallSite: callSiteOff,
6262
},
6363
},
@@ -92,7 +92,7 @@ func (cfg *LoggerConfig) HandlerOptions() []btclog.HandlerOption {
9292
//
9393
//nolint:ll
9494
type FileLoggerConfig struct {
95-
LoggerConfig
95+
*LoggerConfig `yaml:",inline"`
9696
Compressor string `long:"compressor" description:"Compression algorithm to use when rotating logs." choice:"gzip" choice:"zstd"`
9797
MaxLogFiles int `long:"max-files" description:"Maximum logfiles to keep (0 for no rotation)"`
9898
MaxLogFileSize int `long:"max-file-size" description:"Maximum logfile size in MB"`

build/config_dev.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ const (
2424
//
2525
//nolint:ll
2626
type consoleLoggerCfg struct {
27-
LoggerConfig
28-
Style bool `long:"style" description:"If set, the output will be styled with color and fonts"`
27+
*LoggerConfig `yaml:",inline"`
28+
Style bool `long:"style" description:"If set, the output will be styled with color and fonts"`
2929
}
3030

3131
// defaultConsoleLoggerCfg returns the default consoleLoggerCfg for the dev
3232
// console logger.
3333
func defaultConsoleLoggerCfg() *consoleLoggerCfg {
3434
return &consoleLoggerCfg{
35-
LoggerConfig: LoggerConfig{
35+
LoggerConfig: &LoggerConfig{
3636
CallSite: callSiteShort,
3737
},
3838
}

build/config_prod.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ package build
88
//
99
//nolint:ll
1010
type consoleLoggerCfg struct {
11-
LoggerConfig
11+
*LoggerConfig `yaml:",inline"`
1212
}
1313

1414
// defaultConsoleLoggerCfg returns the default consoleLoggerCfg for the prod
1515
// console logger.
1616
func defaultConsoleLoggerCfg() *consoleLoggerCfg {
1717
return &consoleLoggerCfg{
18-
LoggerConfig: LoggerConfig{
18+
LoggerConfig: &LoggerConfig{
1919
CallSite: callSiteOff,
2020
},
2121
}

0 commit comments

Comments
 (0)