diff options
Diffstat (limited to 'playoff.py')
-rw-r--r-- | playoff.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -3,6 +3,7 @@ import traceback from jfr_playoff.filemanager import PlayoffFileManager from jfr_playoff.generator import PlayoffGenerator from jfr_playoff.settings import PlayoffSettings +from jfr_playoff.logger import PlayoffLogger def main(): @@ -15,6 +16,8 @@ def main(): description='Generate play-off HTML for JFR Teamy tournaments') output_args = arg_parser.add_mutually_exclusive_group() output_args.add_argument('-v', '--verbose', action='store_true', + help='display info on STDERR') + output_args.add_argument('-vv', '--debug', action='store_true', help='display debug info on STDERR') output_args.add_argument('-q', '--quiet', action='store_true', help='suppress warnings on STDERR') @@ -23,6 +26,12 @@ def main(): type=str, nargs='?', default=None) arguments = arg_parser.parse_args() + PlayoffLogger.setup('ERROR' if arguments.quiet else ( + 'INFO' if arguments.verbose else ( + 'DEBUG' if arguments.debug else 'WARNING'))) + + PlayoffLogger.get().debug('started with arguments: %s', arguments) + settings = PlayoffSettings(arguments.config_file) interactive = settings.interactive |