Added a logging utility class and supplemented, standardized the logging output for all modules.

This commit is contained in:
戒酒的李白
2025-01-27 18:09:30 +08:00
parent 1288b5f0be
commit c62f2b2a8e
13 changed files with 469 additions and 189 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
import getpass
import pymysql
import logging
from getpass import getpass
from utils.logger import app_logger as logging
# 配置日志
logging.basicConfig(
@@ -28,7 +28,7 @@ def get_db_connection_interactive():
port = 3306
user = input(" 3. 用户名 (默认: root): ") or "root"
password = getpass.getpass(" 4. 密码 (默认: 12345678): ") or "12345678"
password = getpass(" 4. 密码 (默认: 12345678): ") or "12345678"
db_name = input(" 5. 数据库名 (默认: Weibo_PublicOpinion_AnalysisSystem): ") or "Weibo_PublicOpinion_AnalysisSystem"
logging.info(f"尝试连接到数据库: {user}@{host}:{port}/{db_name}")