From 0180755b1f5067a04343ecc07120ebc2ff86f3fc Mon Sep 17 00:00:00 2001 From: Uwe Pfeifer Date: Fri, 11 Nov 2022 22:46:24 +0100 Subject: [PATCH] changed the logging a bit. --- pybot-f.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pybot-f.py b/pybot-f.py index 05def93..3d7a1b3 100644 --- a/pybot-f.py +++ b/pybot-f.py @@ -9,11 +9,14 @@ from discord.ext import commands import logging # 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) +discord.utils.setup_logging(handler=handler) + +# 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 :)'''