Add flags to configure log rotation

* Add & enable --disable-log-rotation

* Add --max-log-count

* Correct max-log-count: remove action=store_true add type=int

* Add logging to cli argument groups.

* Add logging group to HELP_TOPICS in __init__

* Adjust line length

* test simplifying to one argument
This commit is contained in:
John Harlan 2017-02-08 18:29:29 -05:00 committed by Brad Warren
parent 48ef16ab0d
commit fad1a4b576

View file

@ -440,8 +440,8 @@ class HelpfulArgumentParser(object):
}
# List of topics for which additional help can be provided
HELP_TOPICS = ["all", "security", "paths", "automation", "testing"] + list(self.VERBS)
HELP_TOPICS += self.COMMANDS_TOPICS + ["manage"]
HELP_TOPICS = ["all", "security", "paths", "automation", "testing"]
HELP_TOPICS += list(self.VERBS) + self.COMMANDS_TOPICS + ["manage"]
plugin_names = list(plugins)
self.help_topics = HELP_TOPICS + plugin_names + [None]
@ -849,6 +849,16 @@ def prepare_and_parse_args(plugins, args, detect_defaults=False): # pylint: dis
helpful.add(
None, "-t", "--text", dest="text_mode", action="store_true",
help=argparse.SUPPRESS)
helpful.add(
# Note, 1 is subtracted from max_log_count in certbot/main.py
#> to correct an off by one error.
[None, "paths"],
"--max-log-count", dest="max_log_count",
type=int, default=1000,
help="Specifies the maximum number of certbot log files "
"that will be kept. 0 disables log rotation. 1 causes "
"only the log from the most recent run to be kept. "
"2+ enables log rotation at start of certbot execution.")
helpful.add(
[None, "automation", "run", "certonly"], "-n", "--non-interactive", "--noninteractive",
dest="noninteractive_mode", action="store_true",