Merge pull request #1613 from khaledhosny/varlib-cli-logging

[varLib] Command-line options to configure logging
This commit is contained in:
Khaled Hosny 2019-05-18 03:59:10 +02:00 committed by GitHub
commit 6f5bb7822f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1046,10 +1046,21 @@ def main(args=None):
'name. The default value is "%(default)s".' 'name. The default value is "%(default)s".'
) )
) )
logging_group = parser.add_mutually_exclusive_group(required=False)
logging_group.add_argument(
"-v", "--verbose",
action="store_true",
help="Run more verbosely.")
logging_group.add_argument(
"-q", "--quiet",
action="store_true",
help="Turn verbosity off.")
options = parser.parse_args(args) options = parser.parse_args(args)
# TODO: allow user to configure logging via command-line options configLogger(level=(
configLogger(level="INFO") "DEBUG" if options.verbose else
"ERROR" if options.quiet else
"INFO"))
designspace_filename = options.designspace designspace_filename = options.designspace
finder = MasterFinder(options.master_finder) finder = MasterFinder(options.master_finder)