From d8f4fea4365566359d806733b9ba1ba4cb4654c7 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Thu, 6 Aug 2020 20:43:01 +0100 Subject: [PATCH] Creating logging. Trying to reproduce error --- main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.py b/main.py index 50de7f96..16f9bb7e 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,5 @@ import datetime +import logging import string import aiohttp @@ -13,6 +14,13 @@ import settings from settings import blank_space, enso_embedmod_colours, enso_guild_ID, enso_newpeople_ID, get_prefix_for_guild, \ cache, del_cache +logging.basicConfig(level=logging.DEBUG) +logger = logging.getLogger('discord') +logger.setLevel(logging.DEBUG) +handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w') +handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s')) +logger.addHandler(handler) + # Global counter for statuses counter = 0