Skip to content

Commit

Permalink
Make no-logging be the default
Browse files Browse the repository at this point in the history
@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.
  • Loading branch information
billsacks committed May 7, 2018
1 parent 9af6b02 commit 9bb46aa
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions manic/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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',
Expand Down

0 comments on commit 9bb46aa

Please sign in to comment.