From ab5ee8ad896b6a0d724214320a57f6a414ac4d32 Mon Sep 17 00:00:00 2001 From: jmwilliams89 Date: Tue, 16 Nov 2021 09:05:18 -0500 Subject: [PATCH] Changed debug flag to deprecated --- CHANGELOG.md | 4 ++-- cmd/stanza/root.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f85d848a..532141ae4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added agent log file rotation [PR488](https://github.com/observIQ/stanza/pull/488) - Added flags `--max_log_size`, `--max_log_age`, and `--max_log_backups` [PR488](https://github.com/observIQ/stanza/pull/488) -### Removed +### Changed -- Replaced `--debug` flag with a more explicit `--log_level` flag [PR488](https://github.com/observIQ/stanza/pull/488) +- Deprecated the `--debug` flag in favor of the `--log_level` flag [PR488](https://github.com/observIQ/stanza/pull/488) ## 1.3.0 diff --git a/cmd/stanza/root.go b/cmd/stanza/root.go index 67689203c..ea9ac2d5c 100644 --- a/cmd/stanza/root.go +++ b/cmd/stanza/root.go @@ -35,6 +35,7 @@ type RootFlags struct { MaxLogSize int MaxLogBackups int MaxLogAge int + Debug bool } // NewRootCmd will return a root level command @@ -55,6 +56,7 @@ func NewRootCmd() *cobra.Command { rootFlagSet.IntVar(&rootFlags.MaxLogSize, "max_log_size", 10, "sets the maximum size of agent log files in MB before rotating") rootFlagSet.IntVar(&rootFlags.MaxLogBackups, "max_log_backups", 5, "sets the maximum number of rotated log files to retain") rootFlagSet.IntVar(&rootFlags.MaxLogAge, "max_log_age", 7, "sets the maximum number of days to retain a rotated log file") + rootFlagSet.BoolVar(&rootFlags.Debug, "debug", false, "debug logging flag - deprecated") rootFlagSet.StringSliceVarP(&rootFlags.ConfigFiles, "config", "c", []string{defaultConfig()}, "path to a config file") rootFlagSet.StringVar(&rootFlags.PluginDir, "plugin_dir", defaultPluginDir(), "path to the plugin directory")