chore: lint error
All checks were successful
build / build (pull_request) Successful in 2m32s
build / build (push) Successful in 2m34s

This commit is contained in:
张泊明518370910136 2025-03-05 02:28:08 -05:00
parent 855b35592f
commit 01949f136a
GPG Key ID: D47306D7062CDA9D

View File

@ -2,7 +2,7 @@ import logging
import sys
from sys import stderr
from types import FrameType
from typing import Optional
from typing import Optional, Union
from loguru import logger as logger
@ -10,6 +10,7 @@ from loguru import logger as logger
# recipe from https://loguru.readthedocs.io/en/stable/overview.html#entirely-compatible-with-standard-logging
class InterceptHandler(logging.Handler):
def emit(self, record: logging.LogRecord) -> None:
level: Union[str, int]
try:
level = logger.level(record.levelname).name
except ValueError: