From 2bfa367ffbda8f15a0906f42a3853bc3b087f4a4 Mon Sep 17 00:00:00 2001 From: luoliangyi <87842688@qq.com> Date: Thu, 27 Oct 2022 17:17:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=A0=87=E8=AE=B0=E4=B8=BAHGBASE=5FINFOTYPE?= =?UTF-8?q?=5FERROR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/base/HGDll.cpp | 3 ++- modules/imgfmt/HGPdfImpl.cpp | 4 ++-- modules/imgproc/HGOCRHanvon.cpp | 4 ++-- modules/imgproc/HGOCRTesseract.cpp | 4 ++-- sdk/webscan/WebServer.cpp | 6 +++--- sdk/webservice/WebServer.cpp | 6 +++--- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/modules/base/HGDll.cpp b/modules/base/HGDll.cpp index b3c34ace..bac387fc 100644 --- a/modules/base/HGDll.cpp +++ b/modules/base/HGDll.cpp @@ -43,13 +43,14 @@ HGResult HGAPI HGBase_CreateDll(const HGChar* fileName, HGDll* dll) void* hDll = dlopen(fileName, RTLD_LAZY); if (NULL == hDll) { - HGBase_WriteInfo(HGBASE_INFOTYPE_DESC, "dlopen Failed, err=%s", dlerror()); + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "dlopen Failed, err=%s", dlerror()); return HGBASE_ERR_FAIL; } #else HMODULE hDll = LoadLibraryExA((const char *)fileName, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); if (NULL == hDll) { + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "dlopen Failed, err=%u", GetLastError()); return HGBASE_ERR_FAIL; } #endif diff --git a/modules/imgfmt/HGPdfImpl.cpp b/modules/imgfmt/HGPdfImpl.cpp index 60b43ca4..1e5d209f 100644 --- a/modules/imgfmt/HGPdfImpl.cpp +++ b/modules/imgfmt/HGPdfImpl.cpp @@ -64,7 +64,7 @@ HGResult HGPdfReaderImpl::Open(const HGChar* fileName) HGResult ret = HGBase_CreateDll(dllPath, &m_dll); if (HGBASE_ERR_OK != ret) { - HGBase_WriteInfo(HGBASE_INFOTYPE_DESC, "Load PDF Library Failed, path=%s", dllPath); + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "Load PDF Library Failed, path=%s", dllPath); return ret; } @@ -568,7 +568,7 @@ HGResult HGPdfImageWriterImpl::Open(const HGChar* fileName) HGResult ret = HGBase_CreateDll(dllPath, &m_dll); if (HGBASE_ERR_OK != ret) { - HGBase_WriteInfo(HGBASE_INFOTYPE_DESC, "Load PDF Library Failed, path=%s", dllPath); + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "Load PDF Library Failed, path=%s", dllPath); return ret; } diff --git a/modules/imgproc/HGOCRHanvon.cpp b/modules/imgproc/HGOCRHanvon.cpp index 09d85d26..2072ef8c 100644 --- a/modules/imgproc/HGOCRHanvon.cpp +++ b/modules/imgproc/HGOCRHanvon.cpp @@ -47,13 +47,13 @@ HGResult HGOCRHanvon::Init() HGResult ret = HGBase_CreateDll(dllPath, &m_dll); if (HGBASE_ERR_OK != ret) { - HGBase_WriteInfo(HGBASE_INFOTYPE_DESC, "Load OCR Library Failed, path=%s", dllPath); + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "Load OCR Library Failed, path=%s", dllPath); return ret; } if (0 != HWOCR_SDKInitialize(&m_ocrHandle)) { - HGBase_WriteInfo(HGBASE_INFOTYPE_DESC, "Init OCR Library Failed"); + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "Init OCR Library Failed"); HGBase_DestroyDll(m_dll); m_dll = NULL; return HGIMGPROC_ERR_FAIL; diff --git a/modules/imgproc/HGOCRTesseract.cpp b/modules/imgproc/HGOCRTesseract.cpp index 33915c00..7a574fd8 100644 --- a/modules/imgproc/HGOCRTesseract.cpp +++ b/modules/imgproc/HGOCRTesseract.cpp @@ -30,7 +30,7 @@ HGResult HGOCRTesseract::Init() m_baseApi = TessBaseAPICreate(); if (NULL == m_baseApi) { - HGBase_WriteInfo(HGBASE_INFOTYPE_DESC, "Init OCR Library Failed"); + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "Init OCR Library Failed"); return HGIMGPROC_ERR_FAIL; } @@ -43,7 +43,7 @@ HGResult HGOCRTesseract::Init() int rc = TessBaseAPIInit3(m_baseApi, dataPath, "chi_sim"); if (0 != rc) { - HGBase_WriteInfo(HGBASE_INFOTYPE_DESC, "Init OCR Library Failed 2"); + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "Init OCR Library Failed 2"); TessBaseAPIDelete(m_baseApi); m_baseApi = NULL; return HGIMGPROC_ERR_FAIL; diff --git a/sdk/webscan/WebServer.cpp b/sdk/webscan/WebServer.cpp index 9419cf9c..01c5f7e4 100644 --- a/sdk/webscan/WebServer.cpp +++ b/sdk/webscan/WebServer.cpp @@ -39,7 +39,7 @@ bool WebServer::Open(HGUShort port) if (-1 == sockServer) #endif { - HGBase_WriteInfo(HGBASE_INFOTYPE_DESC, "open webserver failed 1, port=%u", port); + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "open webserver failed 1, port=%u", port); return false; } @@ -63,7 +63,7 @@ bool WebServer::Open(HGUShort port) #else close(sockServer); #endif - HGBase_WriteInfo(HGBASE_INFOTYPE_DESC, "open webserver failed 2, port=%u", port); + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "open webserver failed 2, port=%u", port); return false; } @@ -75,7 +75,7 @@ bool WebServer::Open(HGUShort port) #else close(sockServer); #endif - HGBase_WriteInfo(HGBASE_INFOTYPE_DESC, "open webserver failed 3, port=%u", port); + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "open webserver failed 3, port=%u", port); return false; } diff --git a/sdk/webservice/WebServer.cpp b/sdk/webservice/WebServer.cpp index 3db3a08b..57c5c92e 100644 --- a/sdk/webservice/WebServer.cpp +++ b/sdk/webservice/WebServer.cpp @@ -44,7 +44,7 @@ bool WebServer::Open(HGUShort port) if (-1 == sockServer) #endif { - HGBase_WriteInfo(HGBASE_INFOTYPE_DESC, "open webserver failed 1, port=%u", port); + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "open webserver failed 1, port=%u", port); return false; } @@ -68,7 +68,7 @@ bool WebServer::Open(HGUShort port) #else close(sockServer); #endif - HGBase_WriteInfo(HGBASE_INFOTYPE_DESC, "open webserver failed 2, port=%u", port); + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "open webserver failed 2, port=%u", port); return false; } @@ -80,7 +80,7 @@ bool WebServer::Open(HGUShort port) #else close(sockServer); #endif - HGBase_WriteInfo(HGBASE_INFOTYPE_DESC, "open webserver failed 3, port=%u", port); + HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "open webserver failed 3, port=%u", port); return false; }