chore(outputs.remotefile): Deprecate trace option (#15970)

This commit is contained in:
Sven Rebhan 2024-10-02 22:40:28 +02:00 committed by GitHub
parent 8561dedb07
commit f42104fa06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 12 deletions

View File

@ -63,10 +63,6 @@ to use them.
## Maximum size of the cache on disk (infinite by default)
# cache_max_size = -1
## Output log messages of the underlying library as debug messages
## NOTE: You need to enable this option AND run Telegraf in debug mode!
# trace = false
## Data format to output.
## Each data format has its own unique set of configuration options, read
## more about them here:

View File

@ -34,7 +34,7 @@ type File struct {
WriteBackInterval config.Duration `toml:"cache_write_back"`
MaxCacheSize config.Size `toml:"cache_max_size"`
UseBatchFormat bool `toml:"use_batch_format"`
Trace bool `toml:"trace"`
Trace bool `toml:"trace" deprecated:"1.33.0;1.35.0;use 'log_level = \"trace\"' instead"`
Log telegraf.Logger `toml:"-"`
root *vfs.VFS
@ -81,10 +81,11 @@ func (f *File) Init() error {
// Redirect logging
fs.LogPrint = func(level fs.LogLevel, text string) {
if !f.Trace {
return
if f.Trace {
f.Log.Debugf("[%s] %s", level.String(), text)
} else {
f.Log.Tracef("[%s] %s", level.String(), text)
}
f.Log.Debugf("[%s] %s", level.String(), text)
}
// Setup custom template functions

View File

@ -33,10 +33,6 @@
## Maximum size of the cache on disk (infinite by default)
# cache_max_size = -1
## Output log messages of the underlying library as debug messages
## NOTE: You need to enable this option AND run Telegraf in debug mode!
# trace = false
## Data format to output.
## Each data format has its own unique set of configuration options, read
## more about them here: