diff scripts/pytouhou @ 566:04ae31809dc7

Move all logging logic to the root logger, we don’t need specific handlers anymore.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 30 Jun 2014 20:37:52 +0200
parents 5f7f859a72f9
children b2269b9c6119
line wrap: on
line diff
--- a/scripts/pytouhou
+++ b/scripts/pytouhou
@@ -25,14 +25,14 @@ defaults = {'data': default_data}
 from pytouhou.options import parse_arguments
 args = parse_arguments(defaults)
 
-import sys
-import logging
-from pytouhou.utils.helpers import get_logger
+verbosity = args.verbosity or 'WARNING'
 
-if args.verbosity is not None:
-    logging.basicConfig(level=getattr(logging, args.verbosity))
-logger = get_logger('pytouhou')
+import logging
+logging.basicConfig(level=getattr(logging, verbosity),
+                    format='[%(name)s] [%(levelname)s]: %(message)s')
 
+logger = logging
+logger.root.name = 'pytouhou'
 
 if args.game == 'EoSD':
     from pytouhou.games.eosd import EoSDCommon as Common, EoSDGame as Game
@@ -124,6 +124,7 @@ def main(window, path, data, stage_num, 
         resource_loader.scan_archives(data)
     except IOError:
         show_simple_message_box(u'Some data files were not found, did you forget the -p option?')
+        import sys
         sys.exit(1)
 
     if stage_num is None: