Merge pull request #9576 from ellemouton/logConfYamlTags

build: add yaml tags to some LogConfig fields
This commit is contained in:
Oliver Gugger authored and GitHub committed 2025-03-04 13:27:11 -06:00
commit 9feb761b4e
3 files changed
+7 -7

No files matched your search

+2 -2
View File
@@ -57,7 +57,7 @@ func DefaultLogConfig() *LogConfig {
Compressor: defaultLogCompressor,
MaxLogFiles: DefaultMaxLogFiles,
MaxLogFileSize: DefaultMaxLogFileSize,
LoggerConfig: LoggerConfig{
LoggerConfig: &LoggerConfig{
CallSite: callSiteOff,
},
},
@@ -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"`
+3 -3
View File
@@ -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,
},
}
+2 -2
View File
@@ -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,
},
}