diff --git a/nonebot/log.py b/nonebot/log.py index 59e031b9..58a420ad 100644 --- a/nonebot/log.py +++ b/nonebot/log.py @@ -54,7 +54,7 @@ class LoguruHandler(logging.Handler): # pragma: no cover except ValueError: level = record.levelno - frame, depth = logging.currentframe(), 2 + frame, depth = sys._getframe(6), 6 while frame and frame.f_code.co_filename == logging.__file__: frame = frame.f_back depth += 1