From 62135dc117a580caf0d24d8efab32771935d0b7f Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Tue, 16 Mar 2021 16:20:58 +0800 Subject: [PATCH] :loud_sound: fix logger color tag --- nonebot/drivers/fastapi.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nonebot/drivers/fastapi.py b/nonebot/drivers/fastapi.py index a2c315f5..d83fc762 100644 --- a/nonebot/drivers/fastapi.py +++ b/nonebot/drivers/fastapi.py @@ -234,8 +234,9 @@ class Driver(BaseDriver): return if x_self_id in self._clients: - logger.warning("There's already a reverse websocket connection, " - f"{adapter.upper()} Bot {x_self_id} ignored.") + logger.opt(colors=True).warning( + "There's already a reverse websocket connection, " + f"{adapter.upper()} Bot {x_self_id} ignored.") await ws.close(code=status.WS_1008_POLICY_VIOLATION) return