🐛 Fix: 修复因 loguru 更新导致的启动和关闭日志 name 不正常 (#2080)

Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
This commit is contained in:
DiheChen 2023-06-03 22:45:46 +08:00 committed by GitHub
parent 6df28dd2a8
commit 491855876b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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