diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..5d5d190 --- /dev/null +++ b/src/__init__.py @@ -0,0 +1,13 @@ +""" +pliblog - 简易,现代化具有色彩的日志记录器 / Easy, Modern and colorful Logger +""" +# encoding = utf-8 +# python 3.13.5 + +from .utils import get_config, set_config, reset_config + +__all__ = [ + "get_config", + "set_config", + "reset_config" +] \ No newline at end of file diff --git a/tests/t-configs.py b/tests/t-configs.py new file mode 100644 index 0000000..6cd90a5 --- /dev/null +++ b/tests/t-configs.py @@ -0,0 +1,26 @@ +import sys +from pathlib import Path + +project_root = Path(__file__).parent.parent +sys.path.append(str(project_root)) + +from src.utils.configs import get_config, set_config, reset_config + +print(f"\n配置更换测试") +set_config("file_level", "DEBUG") +fl = get_config("file_level") +print(fl) + +set_config("file_level", "INFO") +fl = get_config("file_level") +print(fl) + +print(f"\n配置重置测试") +print(reset_config()) + +print(f"\n配置重置后测试") +fl = get_config("file_level") +print(fl) + +print(f"\n未指定配置读取测试") +print(get_config()) \ No newline at end of file