From b6e7c3678196def4f14faa7b8938639c64516f64 Mon Sep 17 00:00:00 2001 From: CramMK Date: Wed, 29 Apr 2020 10:24:01 +0200 Subject: [PATCH] Add Logging file --- aquabot.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/aquabot.py b/aquabot.py index 29cdb0b..e08e340 100644 --- a/aquabot.py +++ b/aquabot.py @@ -18,16 +18,16 @@ import asyncio import loadconfig # LOGGING -#logger = logging.getLogger("discord") +logger = logging.getLogger("discord") # https://docs.python.org/3/library/logging.html#levels -#logger.setLevel(logging.INFO) -#handler = logging.FileHandler( -# filename="logs/discord.log", -# encoding="utf-8", -# mode="w") -#handler.setFormatter( -# logging.Formatter("%(asctime)s:%(levelname)s:%(name)s: %(message)s")) -#logger.addHandler(handler) +logger.setLevel(logging.INFO) +handler = logging.FileHandler( + filename="logs/discord.log", + encoding="utf-8", + mode="w") +handler.setFormatter( + logging.Formatter("%(asctime)s:%(levelname)s:%(name)s: %(message)s")) +logger.addHandler(handler) # INIT THE BOT bot = commands.Bot(