Feature: 嵌套插件名称作用域优化 (#2665)

This commit is contained in:
Ju4tCode
2024-04-20 14:47:12 +08:00
committed by GitHub
parent e15d544341
commit 6bf10aafb7
16 changed files with 262 additions and 131 deletions

View File

@ -266,11 +266,12 @@ def _resolve_combine_expr(obj_str: str) -> type[Driver]:
def _log_patcher(record: "loguru.Record"):
"""使用插件标识优化日志展示"""
record["name"] = (
plugin.name
plugin.id_
if (module_name := record["name"])
and (plugin := get_plugin_by_module_name(module_name))
else (module_name and module_name.split(".")[0])
else (module_name and module_name.split(".", maxsplit=1)[0])
)