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

Added --log-level argument #298

Merged
merged 1 commit into from
Jul 9, 2017
Merged

Added --log-level argument #298

merged 1 commit into from
Jul 9, 2017

Conversation

albertvaka
Copy link
Contributor

Do not limit the log level to be only debug or info.

Copy link
Member

@sgotti sgotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@albertvaka thanks for the PR, can you please rebase and squash in an unique commit? Looks like semaphore, for whatever reason didn't run the build for this PR...

@@ -115,7 +116,8 @@ func init() {
cmdKeeper.PersistentFlags().StringVar(&cfg.pgSUUsername, "pg-su-username", user, "postgres superuser user name. Used for keeper managed instance access and pg_rewind based synchronization. It'll be created on db initialization. Defaults to the name of the effective user running stolon-keeper. Must be the same for all keepers.")
cmdKeeper.PersistentFlags().StringVar(&cfg.pgSUPassword, "pg-su-password", "", "postgres superuser password. Needed for pg_rewind based synchronization. If provided it'll be configured on db initialization. Only one of --pg-su-password or --pg-su-passwordfile is required. Must be the same for all keepers.")
cmdKeeper.PersistentFlags().StringVar(&cfg.pgSUPasswordFile, "pg-su-passwordfile", "", "postgres superuser password file. Requires --pg-su-username. Must be the same for all keepers)")
cmdKeeper.PersistentFlags().BoolVar(&cfg.debug, "debug", false, "enable debug logging")
cmdKeeper.PersistentFlags().StringVar(&cfg.logLevel, "log-level", "info", "debug, info (default), warn or error")
cmdKeeper.PersistentFlags().BoolVar(&cfg.debug, "debug", false, "enable debug logging (deprecated, use log-level instead)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spf13/pflag has a MarkDeprecated command, perhaps we should use it:
https://godoc.org/github.com/spf13/pflag#FlagSet.MarkDeprecated

@albertvaka
Copy link
Contributor Author

Done.

@sgotti
Copy link
Member

sgotti commented Jul 9, 2017

@albertvaka LGTM. Thanks a lot! Merging.

@sgotti sgotti merged commit e93f6fc into sorintlab:master Jul 9, 2017
sgotti added a commit that referenced this pull request Jul 9, 2017
Added --log-level argument
@sgotti sgotti modified the milestone: v0.7.0 Aug 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants