mirror of
https://github.com/Genshin-bots/gsuid_core.git
synced 2025-05-12 06:55:49 +08:00
🐛 优化一下BUG
This commit is contained in:
parent
e48daef821
commit
b54ed4baa1
@ -68,12 +68,14 @@ def format_event(record):
|
|||||||
f'user_pm={event.user_pm}, '
|
f'user_pm={event.user_pm}, '
|
||||||
f'content={content}, '
|
f'content={content}, '
|
||||||
)
|
)
|
||||||
|
message = message.replace('{', '{{').replace('}', '}}')
|
||||||
else:
|
else:
|
||||||
message = '{message}'
|
message = '{message}'
|
||||||
|
|
||||||
|
def_name: str = record['name']
|
||||||
time = '<g>{time:MM-DD HH:mm:ss}</g>'
|
time = '<g>{time:MM-DD HH:mm:ss}</g>'
|
||||||
level = '[<lvl>{level}</lvl>]'
|
level = '[<lvl>{level}</lvl>]'
|
||||||
def_name = '<c><u>{name}</u></c>'
|
def_name = f'<c><u>{".".join(def_name.split(".")[-5:])}</u></c>'
|
||||||
return f'{time} {level} {def_name} | {message} \n'
|
return f'{time} {level} {def_name} | {message} \n'
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ class GsServer:
|
|||||||
def __new__(cls, *args, **kwargs):
|
def __new__(cls, *args, **kwargs):
|
||||||
# 判断sv是否已经被初始化
|
# 判断sv是否已经被初始化
|
||||||
if cls._instance is None:
|
if cls._instance is None:
|
||||||
cls._instance = super().__new__(cls)
|
cls._instance = super(GsServer, cls).__new__(cls, *args, **kwargs)
|
||||||
return cls._instance
|
return cls._instance
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -54,7 +54,7 @@ class GsServer:
|
|||||||
f'plugins.{plugin.name}.__init__'
|
f'plugins.{plugin.name}.__init__'
|
||||||
)
|
)
|
||||||
# 如果发现单文件,则视为单文件插件
|
# 如果发现单文件,则视为单文件插件
|
||||||
if plugin.suffix == '.py':
|
elif plugin.suffix == '.py':
|
||||||
importlib.import_module(f'plugins.{plugin.name[:-3]}')
|
importlib.import_module(f'plugins.{plugin.name[:-3]}')
|
||||||
except Exception as e: # noqa
|
except Exception as e: # noqa
|
||||||
logger.exception(e)
|
logger.exception(e)
|
||||||
|
6
poetry.lock
generated
6
poetry.lock
generated
@ -636,14 +636,14 @@ reference = "mirrors"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fastapi"
|
name = "fastapi"
|
||||||
version = "0.95.0"
|
version = "0.95.1"
|
||||||
description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production"
|
description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production"
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.7"
|
||||||
files = [
|
files = [
|
||||||
{file = "fastapi-0.95.0-py3-none-any.whl", hash = "sha256:daf73bbe844180200be7966f68e8ec9fd8be57079dff1bacb366db32729e6eb5"},
|
{file = "fastapi-0.95.1-py3-none-any.whl", hash = "sha256:a870d443e5405982e1667dfe372663abf10754f246866056336d7f01c21dab07"},
|
||||||
{file = "fastapi-0.95.0.tar.gz", hash = "sha256:99d4fdb10e9dd9a24027ac1d0bd4b56702652056ca17a6c8721eec4ad2f14e18"},
|
{file = "fastapi-0.95.1.tar.gz", hash = "sha256:9569f0a381f8a457ec479d90fa01005cfddaae07546eb1f3fa035bc4797ae7d5"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
|
@ -19,7 +19,7 @@ dnspython==2.3.0 ; python_full_version >= "3.8.1" and python_version < "4.0"
|
|||||||
email-validator==1.3.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
|
email-validator==1.3.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
|
||||||
fastapi-amis-admin==0.5.4 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
|
fastapi-amis-admin==0.5.4 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
|
||||||
fastapi-user-auth==0.5.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
|
fastapi-user-auth==0.5.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
|
||||||
fastapi==0.95.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
|
fastapi==0.95.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
|
||||||
frozenlist==1.3.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
|
frozenlist==1.3.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
|
||||||
gitdb==4.0.10 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
|
gitdb==4.0.10 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
|
||||||
gitpython==3.1.31 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
|
gitpython==3.1.31 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user