From 9bb46aa55ea01dcc5a0ea0b6fba790b3ba9e2155 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 7 May 2018 15:58:46 -0600 Subject: [PATCH] Make no-logging be the default @jedwards4b, @gold2718 and I all feel that no-logging should be the default. This change is made here. I introduced a new --logging option that can be used to turn on logging. I have maintained --no-logging as an option for backwards compatibility - e.g., since cime calls checkout_externals with '--no-logging' - but now --no-logging doesn't actually do anything. --- manic/checkout.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/manic/checkout.py b/manic/checkout.py index e663325..9ddb62f 100755 --- a/manic/checkout.py +++ b/manic/checkout.py @@ -279,8 +279,15 @@ def commandline_arguments(args=None): help='DEVELOPER: output additional debugging ' 'information to the screen and log file.') - parser.add_argument('--no-logging', action='store_true', - help='DEVELOPER: disable logging.') + logging_group = parser.add_mutually_exclusive_group() + + logging_group.add_argument('--logging', dest='do_logging', + action='store_true', + help='DEVELOPER: enable logging.') + logging_group.add_argument('--no-logging', dest='do_logging', + action='store_false', default=False, + help='DEVELOPER: disable logging ' + '(this is the default)') if args: options = parser.parse_args(args) @@ -305,7 +312,7 @@ def main(args): *before* executing the checkout command - i.e., the status that it used to determine if it's safe to proceed with the checkout. """ - if not args.no_logging: + if args.do_logging: logging.basicConfig(filename=LOG_FILE_NAME, format='%(levelname)s : %(asctime)s : %(message)s', datefmt='%Y-%m-%d %H:%M:%S',