diff --git a/bot.py b/bot.py index c3554ce..d8833f2 100644 --- a/bot.py +++ b/bot.py @@ -29,16 +29,12 @@ TWITTER_COLOR = 0x1da1f2 YOUTUBE_COLOR = 0xff0000 -logger = logging.getLogger('discord') -logger.addHandler(logging.StreamHandler()) -logger.setLevel(logging.INFO) - - config = configparser.ConfigParser() config.read(os.getenv('CHEDDAR_KNIGHT_CONFIG', 'settings.cfg')) staging = config.getboolean('General', 'staging', fallback=False) +debug = config.getboolean('General', 'debug', fallback=False) storage_path = config.get('General', 'storage_path') token = config.get('Discord', 'token') @@ -53,6 +49,11 @@ yt_api_key = config.get('YouTube', 'api_key') yt_channel_id = config.get('YouTube', 'channel_id') +logger = logging.getLogger('discord') +logger.addHandler(logging.StreamHandler()) +logger.setLevel(logging.DEBUG if debug else logging.INFO) + + class Bot(discord.Client): def __init__(self): self.commands = (