From 55ff9c766e32626d6766a85518187630c507d95f Mon Sep 17 00:00:00 2001 From: Thanos <111999343+Sachaa-Thanasius@users.noreply.github.com> Date: Mon, 16 Oct 2023 11:58:29 -0400 Subject: [PATCH] Change type of logging queue. --- core/utils/custom_logging.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/utils/custom_logging.py b/core/utils/custom_logging.py index 15e5969..4773812 100644 --- a/core/utils/custom_logging.py +++ b/core/utils/custom_logging.py @@ -10,6 +10,7 @@ import asyncio import logging +import queue from logging.handlers import QueueHandler, QueueListener, RotatingFileHandler from pathlib import Path from typing import TYPE_CHECKING, Any, TypeAlias, TypeVar @@ -128,11 +129,11 @@ def __enter__(self) -> Self: self.log.addHandler(stream_handler) # Add a queue handler and listener. - queue: asyncio.Queue[logging.LogRecord] = asyncio.Queue() - queue_handler = QueueHandler(queue) + log_queue: queue.Queue[logging.LogRecord] = queue.Queue() + queue_handler = QueueHandler(log_queue) webhook = discord.Webhook.from_url(core.CONFIG.discord.logging_webhook, session=self.session) webhook_handler = DiscordWebhookHandler(webhook) - self.queue_listener = QueueListener(queue, webhook_handler) + self.queue_listener = QueueListener(log_queue, webhook_handler) self.log.addHandler(queue_handler) self.queue_listener.start()