diff --git a/pybot-f.py b/pybot-f.py index 47925c7..459cd02 100644 --- a/pybot-f.py +++ b/pybot-f.py @@ -8,8 +8,12 @@ import typing from discord.ext import commands import logging -# Logging -loghandler = logging.FileHandler(filename='bot.log', encoding='utf-8', mode='w') +# Logging +logger = logging.getLogger('discord') +logger.setLevel(logging.INFO) +handler = logging.FileHandler(filename='bot.log', encoding='utf-8', mode='w') +handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s')) +logger.addHandler(handler) # The bots' description description = '''Testing this bot stuff :)''' @@ -26,11 +30,10 @@ config = configparser.ConfigParser() config.read('bot.ini') bottoken = config['General']['bottoken'] -loglevel = logging.getLevelName(config['General']['loglevel']) # Setting up commands.Bot -bot = commands.Bot(command_prefix='.', description=description, intents=intents, log_handler=loghandler, log_level=loglevel) +bot = commands.Bot(command_prefix='.', description=description, intents=intents) @bot.event