mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2025-10-04 18:46:30 +00:00
🔧 重构配置管理,添加配置文件支持,更新日志系统,优化守护进程,完善测试用例
This commit is contained in:
24
liteyukibot/utils/__init__.py
Normal file
24
liteyukibot/utils/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import json
|
||||
from typing import Any
|
||||
|
||||
|
||||
def pretty_print(obj: Any, indent: int=2) -> None:
|
||||
"""
|
||||
更好地打印对象
|
||||
|
||||
Args:
|
||||
obj (Any): 要打印的对象
|
||||
"""
|
||||
print(json.dumps(obj, indent=indent, ensure_ascii=False))
|
||||
|
||||
def pretty_format(obj: Any, indent: int =2 ) -> str:
|
||||
"""
|
||||
更好地格式化对象
|
||||
|
||||
Args:
|
||||
obj (Any): 要格式化的对象
|
||||
|
||||
Returns:
|
||||
str: 格式化后的字符串
|
||||
"""
|
||||
return json.dumps(obj, indent=indent, ensure_ascii=False)
|
Reference in New Issue
Block a user