(logger): Separate error live logging.

This commit is contained in:
2021-09-28 09:03:11 +03:00
parent c1b53cedd2
commit b12a1cdf6c

View File

@@ -71,7 +71,10 @@ def log(message, context="GLOBAL", level=logging.INFO, post=True):
# Live logger that posts to the logging channels # Live logger that posts to the logging channels
async def live_log(message, context, level): async def live_log(message, context, level):
if level >= logging.INFO: 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 # Generate the log messages
header = "[{}][{}]".format(logging.getLevelName(level), str(context)) header = "[{}][{}]".format(logging.getLevelName(level), str(context))