From aad869cd5fdd53e3c181f17aca8652dbfd2f1640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sk=C3=BDpala?= Date: Thu, 30 Mar 2023 15:24:01 +0200 Subject: [PATCH] Added logging --- main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.py b/main.py index feaaa14..495fb7b 100755 --- a/main.py +++ b/main.py @@ -1,6 +1,13 @@ #!/usr/bin/env python3 from discord.ext import commands import utils.data as data +import logging + +logger = logging.getLogger('discord') +logger.setLevel(logging.INFO) +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) CONFIG = data.load_json("config")