From b12a1cdf6c380a92c19ce22c262c1eb55d6b5d8f Mon Sep 17 00:00:00 2001 From: Conatum Date: Tue, 28 Sep 2021 09:03:11 +0300 Subject: [PATCH] (logger): Separate error live logging. --- bot/meta/logger.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/meta/logger.py b/bot/meta/logger.py index c6d916d9..858b1292 100644 --- a/bot/meta/logger.py +++ b/bot/meta/logger.py @@ -71,7 +71,10 @@ def log(message, context="GLOBAL", level=logging.INFO, post=True): # Live logger that posts to the logging channels async def live_log(message, context, level): if level >= logging.INFO: - log_chid = conf.bot.getint('log_channel') + if level >= logging.WARNING: + log_chid = conf.bot.getint('error_channel') or conf.bot.getint('log_channel') + else: + log_chid = conf.bot.getint('log_channel') # Generate the log messages header = "[{}][{}]".format(logging.getLevelName(level), str(context))