From 36ecd5625aae6b80855320945a5634178b0fff47 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Mon, 18 Apr 2016 15:33:58 +0100 Subject: [PATCH] [UI] Cleanup logrotate option Keeps a consistent naming for log options --- deluge/ui/baseargparser.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/deluge/ui/baseargparser.py b/deluge/ui/baseargparser.py index fa5793a08..dabd9554c 100644 --- a/deluge/ui/baseargparser.py +++ b/deluge/ui/baseargparser.py @@ -103,11 +103,11 @@ class BaseArgParser(argparse.ArgumentParser): help="Output to designated logfile instead of stdout") self.group.add_argument("-L", "--loglevel", action="store", choices=deluge.log.levels, metavar='', help="Set the log level: %s" % ", ".join(deluge.log.levels)) + self.group.add_argument("--logrotate", action="store", nargs="?", const="2M", metavar='', + help="Enable logfile rotation, takes an optional maximum logfile size, " + "default: %(const)s (Logfile rotatation count is 5)") self.group.add_argument("-q", "--quiet", action="store_true", default=False, help="Sets the log level to 'none', this is the same as `-L none`") - self.group.add_argument("--log-rotate", action="store", nargs="?", const="50M", - help="Enable logfile rotation (optional max file size, default: %(const)s)." - "Log file rotate count is 5") self.group.add_argument("--profile", metavar="", action="store", nargs="?", default=False, help="Profile %(prog)s with cProfile. Prints results to stdout" "unless a filename is specififed") @@ -126,10 +126,10 @@ class BaseArgParser(argparse.ArgumentParser): options.loglevel = options.loglevel.lower() logfile_mode = 'w' - logrotate = options.log_rotate - if options.log_rotate: + logrotate = options.logrotate + if options.logrotate: logfile_mode = 'a' - logrotate = common.parse_human_size(options.log_rotate) + logrotate = common.parse_human_size(options.logrotate) # Setup the logger setup_logger(level=options.loglevel, filename=options.logfile, filemode=logfile_mode,