comparison 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
comparison
equal deleted inserted replaced
565:5f7f859a72f9 566:04ae31809dc7
23 defaults = {'data': default_data} 23 defaults = {'data': default_data}
24 24
25 from pytouhou.options import parse_arguments 25 from pytouhou.options import parse_arguments
26 args = parse_arguments(defaults) 26 args = parse_arguments(defaults)
27 27
28 import sys 28 verbosity = args.verbosity or 'WARNING'
29
29 import logging 30 import logging
30 from pytouhou.utils.helpers import get_logger 31 logging.basicConfig(level=getattr(logging, verbosity),
31 32 format='[%(name)s] [%(levelname)s]: %(message)s')
32 if args.verbosity is not None: 33
33 logging.basicConfig(level=getattr(logging, args.verbosity)) 34 logger = logging
34 logger = get_logger('pytouhou') 35 logger.root.name = 'pytouhou'
35
36 36
37 if args.game == 'EoSD': 37 if args.game == 'EoSD':
38 from pytouhou.games.eosd import EoSDCommon as Common, EoSDGame as Game 38 from pytouhou.games.eosd import EoSDCommon as Common, EoSDGame as Game
39 39
40 if args.interface == 'EoSD': 40 if args.interface == 'EoSD':
122 122
123 try: 123 try:
124 resource_loader.scan_archives(data) 124 resource_loader.scan_archives(data)
125 except IOError: 125 except IOError:
126 show_simple_message_box(u'Some data files were not found, did you forget the -p option?') 126 show_simple_message_box(u'Some data files were not found, did you forget the -p option?')
127 import sys
127 sys.exit(1) 128 sys.exit(1)
128 129
129 if stage_num is None: 130 if stage_num is None:
130 story = True 131 story = True
131 stage_num = 1 132 stage_num = 1