QGIS修改日志报错
This commit is contained in:
+11
-9
@@ -19,13 +19,15 @@ DBN_CONFIG_DIR = CONFIG_DIR / "dbn"
|
||||
|
||||
def get_logger(name: str = "algorithm"):
|
||||
"""
|
||||
获取日志记录器的便捷函数
|
||||
|
||||
Args:
|
||||
name: 日志名称
|
||||
|
||||
Returns:
|
||||
logging.Logger 实例
|
||||
获取日志记录器。主进程用 loguru,QGIS 子进程回退到标准 logging。
|
||||
"""
|
||||
from app.utils.logger import get_logger as _get_logger
|
||||
return _get_logger(name, str(LOG_DIR))
|
||||
try:
|
||||
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)
|
||||
|
||||
@@ -30,6 +30,8 @@ set "GDAL_FILENAME_IS_UTF8=YES"
|
||||
set "VSI_CACHE=TRUE"
|
||||
set "VSI_CACHE_SIZE=1000000"
|
||||
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 --- 启动 ---
|
||||
"%PY%\python3.exe" %*
|
||||
|
||||
Reference in New Issue
Block a user