🔇 Feature: 调整日志输出格式与等级 (#1233)

This commit is contained in:
Ju4tCode
2022-09-09 11:52:57 +08:00
committed by GitHub
parent 179d7105c9
commit 8c42490a7e
29 changed files with 261 additions and 165 deletions

View File

@ -27,7 +27,7 @@ from nonebot.drivers import HTTPVersion, ForwardMixin, ForwardDriver, combine_dr
try:
import aiohttp
except ImportError:
except ImportError: # pragma: no cover
raise ImportError(
"Please install aiohttp first to use this driver. `pip install nonebot2[aiohttp]`"
) from None

View File

@ -31,7 +31,7 @@ from nonebot.drivers import (
try:
import httpx
except ImportError:
except ImportError: # pragma: no cover
raise ImportError(
"Please install httpx by using `pip install nonebot2[httpx]`"
) from None

View File

@ -37,7 +37,7 @@ try:
from quart import Quart, Request, Response
from quart.datastructures import FileStorage
from quart import Websocket as QuartWebSocket
except ImportError:
except ImportError: # pragma: no cover
raise ImportError(
"Please install Quart by using `pip install nonebot2[quart]`"
) from None

View File

@ -30,10 +30,10 @@ from nonebot.drivers import ForwardMixin, ForwardDriver, combine_driver
try:
from websockets.exceptions import ConnectionClosed
from websockets.legacy.client import Connect, WebSocketClientProtocol
except ImportError:
except ImportError: # pragma: no cover
raise ImportError(
"Please install websockets by using `pip install nonebot2[websockets]`"
)
) from None
logger = logging.Logger("websockets.client", "INFO")
logger.addHandler(LoguruHandler())