QGIS修改日志报错

This commit is contained in:
wzy-warehouse
2026-06-20 17:04:24 +08:00
parent 4fb65f7f53
commit ca14e931f8
2 changed files with 13 additions and 9 deletions
+11 -9
View File
@@ -19,13 +19,15 @@ DBN_CONFIG_DIR = CONFIG_DIR / "dbn"
def get_logger(name: str = "algorithm"): def get_logger(name: str = "algorithm"):
""" """
获取日志记录器的便捷函数 获取日志记录器。主进程用 loguruQGIS 子进程回退到标准 logging。
Args:
name: 日志名称
Returns:
logging.Logger 实例
""" """
from app.utils.logger import get_logger as _get_logger try:
return _get_logger(name, str(LOG_DIR)) from app.utils.logger import get_logger as _get_logger
return _get_logger(name, str(LOG_DIR))
except ImportError:
import logging
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(threadName)s] %(levelname)-5s %(name)s - %(message)s",
)
return logging.getLogger(name)
+2
View File
@@ -30,6 +30,8 @@ set "GDAL_FILENAME_IS_UTF8=YES"
set "VSI_CACHE=TRUE" set "VSI_CACHE=TRUE"
set "VSI_CACHE_SIZE=1000000" set "VSI_CACHE_SIZE=1000000"
set "PATH=%QGIS_APP%\bin;%QGIS_ROOT%\apps\Qt5\bin;%QGIS_ROOT%\apps\gdal\lib;%PATH%" set "PATH=%QGIS_APP%\bin;%QGIS_ROOT%\apps\Qt5\bin;%QGIS_ROOT%\apps\gdal\lib;%PATH%"
REM 强制使用 QGIS 自带的 PROJ,避免 PostgreSQL/PostGIS 的旧 proj.db 干扰
if exist "%QGIS_ROOT%\share\proj" set "PROJ_DATA=%QGIS_ROOT%\share\proj"
REM --- 启动 --- REM --- 启动 ---
"%PY%\python3.exe" %* "%PY%\python3.exe" %*