build: add yaml tags to embedded LogConfig structs

For any embedded struct, the `yaml:",inline"` tag is required.
This commit is contained in:
Elle Mouton 2025-03-04 12:51:59 +02:00
parent f744a5477f
commit 1dec8ab985
No known key found for this signature in database
GPG Key ID: D7D916376026F177
3 changed files with 7 additions and 7 deletions

@ -57,7 +57,7 @@ func DefaultLogConfig() *LogConfig {
Compressor: defaultLogCompressor, Compressor: defaultLogCompressor,
MaxLogFiles: DefaultMaxLogFiles, MaxLogFiles: DefaultMaxLogFiles,
MaxLogFileSize: DefaultMaxLogFileSize, MaxLogFileSize: DefaultMaxLogFileSize,
LoggerConfig: LoggerConfig{ LoggerConfig: &LoggerConfig{
CallSite: callSiteOff, CallSite: callSiteOff,
}, },
}, },
@ -92,7 +92,7 @@ func (cfg *LoggerConfig) HandlerOptions() []btclog.HandlerOption {
// //
//nolint:ll //nolint:ll
type FileLoggerConfig struct { type FileLoggerConfig struct {
LoggerConfig *LoggerConfig `yaml:",inline"`
Compressor string `long:"compressor" description:"Compression algorithm to use when rotating logs." choice:"gzip" choice:"zstd"` Compressor string `long:"compressor" description:"Compression algorithm to use when rotating logs." choice:"gzip" choice:"zstd"`
MaxLogFiles int `long:"max-files" description:"Maximum logfiles to keep (0 for no rotation)"` MaxLogFiles int `long:"max-files" description:"Maximum logfiles to keep (0 for no rotation)"`
MaxLogFileSize int `long:"max-file-size" description:"Maximum logfile size in MB"` MaxLogFileSize int `long:"max-file-size" description:"Maximum logfile size in MB"`

@ -24,15 +24,15 @@ const (
// //
//nolint:ll //nolint:ll
type consoleLoggerCfg struct { type consoleLoggerCfg struct {
LoggerConfig *LoggerConfig `yaml:",inline"`
Style bool `long:"style" description:"If set, the output will be styled with color and fonts"` Style bool `long:"style" description:"If set, the output will be styled with color and fonts"`
} }
// defaultConsoleLoggerCfg returns the default consoleLoggerCfg for the dev // defaultConsoleLoggerCfg returns the default consoleLoggerCfg for the dev
// console logger. // console logger.
func defaultConsoleLoggerCfg() *consoleLoggerCfg { func defaultConsoleLoggerCfg() *consoleLoggerCfg {
return &consoleLoggerCfg{ return &consoleLoggerCfg{
LoggerConfig: LoggerConfig{ LoggerConfig: &LoggerConfig{
CallSite: callSiteShort, CallSite: callSiteShort,
}, },
} }

@ -8,14 +8,14 @@ package build
// //
//nolint:ll //nolint:ll
type consoleLoggerCfg struct { type consoleLoggerCfg struct {
LoggerConfig *LoggerConfig `yaml:",inline"`
} }
// defaultConsoleLoggerCfg returns the default consoleLoggerCfg for the prod // defaultConsoleLoggerCfg returns the default consoleLoggerCfg for the prod
// console logger. // console logger.
func defaultConsoleLoggerCfg() *consoleLoggerCfg { func defaultConsoleLoggerCfg() *consoleLoggerCfg {
return &consoleLoggerCfg{ return &consoleLoggerCfg{
LoggerConfig: LoggerConfig{ LoggerConfig: &LoggerConfig{
CallSite: callSiteOff, CallSite: callSiteOff,
}, },
} }