Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add yaml tags to some LogConfig fields #9576

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func DefaultLogConfig() *LogConfig {
Compressor: defaultLogCompressor,
MaxLogFiles: DefaultMaxLogFiles,
MaxLogFileSize: DefaultMaxLogFileSize,
LoggerConfig: LoggerConfig{
LoggerConfig: &LoggerConfig{
CallSite: callSiteOff,
},
},
Expand Down Expand Up @@ -92,7 +92,7 @@ func (cfg *LoggerConfig) HandlerOptions() []btclog.HandlerOption {
//
//nolint:ll
type FileLoggerConfig struct {
LoggerConfig
*LoggerConfig `yaml:",inline"`
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)"`
MaxLogFileSize int `long:"max-file-size" description:"Maximum logfile size in MB"`
Expand Down
6 changes: 3 additions & 3 deletions build/config_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ const (
//
//nolint:ll
type consoleLoggerCfg struct {
LoggerConfig
Style bool `long:"style" description:"If set, the output will be styled with color and fonts"`
*LoggerConfig `yaml:",inline"`
Style bool `long:"style" description:"If set, the output will be styled with color and fonts"`
}

// defaultConsoleLoggerCfg returns the default consoleLoggerCfg for the dev
// console logger.
func defaultConsoleLoggerCfg() *consoleLoggerCfg {
return &consoleLoggerCfg{
LoggerConfig: LoggerConfig{
LoggerConfig: &LoggerConfig{
CallSite: callSiteShort,
},
}
Expand Down
4 changes: 2 additions & 2 deletions build/config_prod.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ package build
//
//nolint:ll
type consoleLoggerCfg struct {
LoggerConfig
*LoggerConfig `yaml:",inline"`
}

// defaultConsoleLoggerCfg returns the default consoleLoggerCfg for the prod
// console logger.
func defaultConsoleLoggerCfg() *consoleLoggerCfg {
return &consoleLoggerCfg{
LoggerConfig: LoggerConfig{
LoggerConfig: &LoggerConfig{
CallSite: callSiteOff,
},
}
Expand Down
Loading