mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 06:55:36 +08:00
🐛 Fix: 修复因 loguru 更新导致的启动和关闭日志 name 不正常 (#2080)
Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
This commit is contained in:
parent
6df28dd2a8
commit
491855876b
@ -54,7 +54,7 @@ class LoguruHandler(logging.Handler): # pragma: no cover
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
level = record.levelno
|
level = record.levelno
|
||||||
|
|
||||||
frame, depth = logging.currentframe(), 2
|
frame, depth = sys._getframe(6), 6
|
||||||
while frame and frame.f_code.co_filename == logging.__file__:
|
while frame and frame.f_code.co_filename == logging.__file__:
|
||||||
frame = frame.f_back
|
frame = frame.f_back
|
||||||
depth += 1
|
depth += 1
|
||||||
|
Loading…
Reference in New Issue
Block a user