diff --git a/main.py b/main.py index 1a01c2d..e88b8ef 100644 --- a/main.py +++ b/main.py @@ -1,3 +1,4 @@ +import argparse import logging import os import pickle @@ -12,7 +13,16 @@ from config import (RESOLUTION, MAP_RESOLUTION, from objects import Snake, Apple from utils import get_score_text, Direction -logging.basicConfig(level=logging.DEBUG) + +parser = argparse.ArgumentParser() +parser.add_argument('-v', '--verbose', help='Show debug logs', action='store_true') +args = parser.parse_args() + +level = logging.INFO +if args.verbose: + level = logging.DEBUG + +logging.basicConfig(level=level) logger = logging.getLogger(__name__) pygame.init()