# HG changeset patch # User Emmanuel Gil Peyrot # Date 1374002036 -7200 # Node ID 236bc32597f1a22d44e4e314de790193e423edf3 # Parent b0b8825296d0cbdbe035d157491a57d04a27e282 Add a --verbosity option, to disable logging for machines with a very slow terminal. diff --git a/eosd b/eosd --- a/eosd +++ b/eosd @@ -65,7 +65,8 @@ class EoSDGameBossRush(EoSDGame): def main(path, data, stage_num, rank, character, replay, save_filename, skip_replay, boss_rush, fps_limit, single_buffer, debug, - fixed_pipeline, display_background, display_particles, hints): + fixed_pipeline, display_background, display_particles, hints, + verbosity): resource_loader = Loader(path) @@ -84,9 +85,13 @@ def main(path, data, stage_num, rank, ch continues = 0 if debug: - logging.basicConfig(level=logging.DEBUG) + if not verbosity: + verbosity = 'DEBUG' continues = float('inf') + if verbosity: + logging.basicConfig(level=logging.__getattribute__(verbosity)) + if replay: with open(replay, 'rb') as file: replay = T6RP.read(file) @@ -215,10 +220,11 @@ parser.add_argument('--fixed-pipeline', parser.add_argument('--no-background', action='store_false', help='Disable background display (huge performance boost on slow systems).') parser.add_argument('--no-particles', action='store_false', help='Disable particles handling (huge performance boost on slow systems).') parser.add_argument('--hints', metavar='HINTS', default=None, help='Hints file, to display text while playing.') +parser.add_argument('--verbosity', metavar='VERBOSITY', choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], help='Select the wanted logging level.') args = parser.parse_args() main(args.path, tuple(args.data), args.stage, args.rank, args.character, args.replay, args.save_replay, args.skip_replay, args.boss_rush, args.fps_limit, args.single_buffer, args.debug, args.fixed_pipeline, - args.no_background, args.no_particles, args.hints) + args.no_background, args.no_particles, args.hints, args.verbosity)