Skip to content

Commit 0427305

Browse files
authored
Merge pull request #103 from billsacks/no_logging
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. User interface changes?: Yes `--no-logging` is now the default, new `--logging option` to turn on logging. I have kept `--no-logging` in place to ensure backwards compatibility. Fixes: #95 (Should not write to log file when running status command) As noted in #97, @jedwards4b, @gold2718 and I felt that logging should always be off by default. Testing: test removed: none unit tests: pass system tests: pass manual testing: Ran with `--logging`, `--no-logging`, both and neither, with python2 and python3 (note that running with both generates an error message)
2 parents 9af6b02 + 9bb46aa commit 0427305

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

manic/checkout.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,15 @@ def commandline_arguments(args=None):
279279
help='DEVELOPER: output additional debugging '
280280
'information to the screen and log file.')
281281

282-
parser.add_argument('--no-logging', action='store_true',
283-
help='DEVELOPER: disable logging.')
282+
logging_group = parser.add_mutually_exclusive_group()
283+
284+
logging_group.add_argument('--logging', dest='do_logging',
285+
action='store_true',
286+
help='DEVELOPER: enable logging.')
287+
logging_group.add_argument('--no-logging', dest='do_logging',
288+
action='store_false', default=False,
289+
help='DEVELOPER: disable logging '
290+
'(this is the default)')
284291

285292
if args:
286293
options = parser.parse_args(args)
@@ -305,7 +312,7 @@ def main(args):
305312
*before* executing the checkout command - i.e., the status that it
306313
used to determine if it's safe to proceed with the checkout.
307314
"""
308-
if not args.no_logging:
315+
if args.do_logging:
309316
logging.basicConfig(filename=LOG_FILE_NAME,
310317
format='%(levelname)s : %(asctime)s : %(message)s',
311318
datefmt='%Y-%m-%d %H:%M:%S',

0 commit comments

Comments
 (0)