mirror of
https://github.com/Nanaloveyuki/py-logiliteal.git
synced 2025-09-04 02:26:23 +00:00
✅ 更新tests
文件夹下的导入
This commit is contained in:
@ -7,8 +7,8 @@
|
|||||||
"enable_console": true,
|
"enable_console": true,
|
||||||
"enable_file": true,
|
"enable_file": true,
|
||||||
"console_color": true,
|
"console_color": true,
|
||||||
"console_level": "DEBUG",
|
"console_level": "INFO",
|
||||||
"console_format": "{asctime} {levelname} | {prefix}{message}",
|
"console_format": "{time} {levelname} | {prefix}{message}",
|
||||||
"console_prefix": "Auto",
|
"console_prefix": "Auto",
|
||||||
"console_encoding": "utf-8",
|
"console_encoding": "utf-8",
|
||||||
"date_format": "%Y-%m-%d %H:%M:%S",
|
"date_format": "%Y-%m-%d %H:%M:%S",
|
||||||
@ -21,7 +21,7 @@
|
|||||||
},
|
},
|
||||||
"level_color": {
|
"level_color": {
|
||||||
"DEBUG": "#c1d5ff",
|
"DEBUG": "#c1d5ff",
|
||||||
"INFO": "#c1f8ff",
|
"INFO": "#c1ffff",
|
||||||
"WARN": "#fff600",
|
"WARN": "#fff600",
|
||||||
"ERRO": "#ffa000",
|
"ERRO": "#ffa000",
|
||||||
"CRIT": "#ff8181"
|
"CRIT": "#ff8181"
|
||||||
|
@ -17,7 +17,7 @@ DEFAULT_CONFIG = {
|
|||||||
"enable_file": True,
|
"enable_file": True,
|
||||||
"console_color": True,
|
"console_color": True,
|
||||||
"console_level": "INFO",
|
"console_level": "INFO",
|
||||||
"console_format": "{asctime} {levelname} | {prefix}{message}",
|
"console_format": "{time} {levelname} | {prefix}{message}",
|
||||||
"console_prefix": "Auto",
|
"console_prefix": "Auto",
|
||||||
"console_encoding": "utf-8",
|
"console_encoding": "utf-8",
|
||||||
"date_format": "%Y-%m-%d %H:%M:%S",
|
"date_format": "%Y-%m-%d %H:%M:%S",
|
||||||
|
@ -4,7 +4,7 @@ from pathlib import Path
|
|||||||
project_root = Path(__file__).parent.parent
|
project_root = Path(__file__).parent.parent
|
||||||
sys.path.append(str(project_root))
|
sys.path.append(str(project_root))
|
||||||
|
|
||||||
from src.utils.configs import get_config, set_config, reset_config
|
from src.logiliteal.utils.configs import get_config, set_config, reset_config
|
||||||
|
|
||||||
print(f"\n配置更换测试")
|
print(f"\n配置更换测试")
|
||||||
set_config("file_level", "DEBUG")
|
set_config("file_level", "DEBUG")
|
||||||
|
@ -4,7 +4,7 @@ from pathlib import Path
|
|||||||
project_root = Path(__file__).parent.parent
|
project_root = Path(__file__).parent.parent
|
||||||
sys.path.append(str(project_root))
|
sys.path.append(str(project_root))
|
||||||
|
|
||||||
from src.utils.fmt import fmt_level, fmt_level_number, fmt_console, fmt_message, fmt_placeholder
|
from src.logiliteal.utils.fmt import fmt_level, fmt_level_number, fmt_console, fmt_message, fmt_placeholder
|
||||||
|
|
||||||
print("日志级别测试")
|
print("日志级别测试")
|
||||||
print(fmt_level("DEBUG"))
|
print(fmt_level("DEBUG"))
|
||||||
|
@ -4,9 +4,12 @@ from pathlib import Path
|
|||||||
project_root = Path(__file__).parent.parent
|
project_root = Path(__file__).parent.parent
|
||||||
sys.path.append(str(project_root))
|
sys.path.append(str(project_root))
|
||||||
|
|
||||||
from src import Logger
|
from src.logiliteal import Logger
|
||||||
|
|
||||||
log = Logger()
|
log = Logger()
|
||||||
|
|
||||||
log.info("测试信息日志")
|
log.info("测试信息日志")
|
||||||
log.debug("测试调试日志")
|
log.debug("测试调试日志")
|
||||||
|
log.warn("测试警告日志")
|
||||||
|
log.error("测试错误日志")
|
||||||
|
log.critical("测试严重错误日志")
|
Reference in New Issue
Block a user