浏览代码

#IQRV #comment 相关实体日志精简

80374374 4 月之前
父节点
当前提交
3d58351906

+ 2 - 2
Module/include/CommEntityUtil.hpp

@@ -115,7 +115,7 @@ namespace Module
 				SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &stLocal);
 				sprintf_s(temp, 22, "%d-%02d-%02d %02d:%02d:%02d",
 					stLocal.wYear, stLocal.wMonth, stLocal.wDay, stLocal.wHour, stLocal.wMinute, stLocal.wSecond);
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("OSStartTime: %s", temp);
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("OSStartTime: %s", temp);
 				systemBootTime.FromSystemTime(stLocal);
 				fSuc = TRUE;
 			}
@@ -160,7 +160,7 @@ namespace Module
 			systemTime.wMilliseconds = (WORD)(ticks % 1000);
 
 			systemBootTime.FromSystemTime(systemTime);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("OSStartTime: %s", systemBootTime.ToTimeString().GetData());
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("OSStartTime: %s", systemBootTime.ToTimeString().GetData());
 			return TRUE;
 #endif //_MSC_VER
 		}

+ 6 - 15
Module/mod_HSPScanner/HSPScannerFSM.cpp

@@ -1503,7 +1503,6 @@ int CHSPScannerFSM::StartPreview(SpReqAnsContext<HSPScannerService_StartPreview_
 			SetLastUserCode(dwCode);
 		}
 	} else if (ISSUCCEEDED(erroCode)) {
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("Start to SetPreview(1)...");
 		const ULONGLONG ullStart = SP::Module::Comm::RVCGetTickCount();
 		erroCode = m_hDevHelper->SetPreview(1);
 		const ULONGLONG ullEnd = SP::Module::Comm::RVCGetTickCount();
@@ -1547,7 +1546,6 @@ int CHSPScannerFSM::StopPreview(SpReqAnsContext<HSPScannerService_CancelPreview_
 	}
 	else
 	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("Start to SetPreview(0).");
 		const ULONGLONG ullStart = SP::Module::Comm::RVCGetTickCount();
 		erroCode = m_hDevHelper->SetPreview(0);
 		const ULONGLONG ullEnd = SP::Module::Comm::RVCGetTickCount();
@@ -1591,10 +1589,8 @@ bool CHSPScannerFSM::ResizeImage(const CSimpleStringA& fileName, int kbSize)
 	long fileSize = ftell(fHandle);
 	fclose(fHandle);
 	if (fileSize <= (imageSize)) {
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("File(%s)(%u<=%u) no need resize.", (LPCTSTR)fileName, fileSize, imageSize);
 		return TRUE;
 	}
-
 	CSimpleStringA backUpFile, backUpPath;
     m_pEntity->GetFunction()->GetPath("Temp", backUpPath);
 	backUpFile = backUpPath + SPLIT_SLASH_STR + "backupHSPSCannerImage";
@@ -1615,7 +1611,6 @@ bool CHSPScannerFSM::ResizeImage(const CSimpleStringA& fileName, int kbSize)
 			success = FALSE;
 			break;
 		}
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("to resize %lf rate...", rate);
 		width = img.cols;
 		height = img.rows;
 		cv::resize(img, img, cv::Size(width * rate, height * rate));
@@ -1644,7 +1639,6 @@ bool CHSPScannerFSM::ResizeImage(const CSimpleStringA& fileName, int kbSize)
 	}
 	fileSize = fileSize / 1024;
 	DeleteFileIfExisted(backUpFile);
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("HSPScanner resize image succeed, SIZE : %d KB.", fileSize);
 	return TRUE;
 }
 
@@ -1666,7 +1660,7 @@ int CHSPScannerFSM::ScanImage(SpReqAnsContext<HSPScannerService_ScanImage_Req,
 	erroCode = m_hDevHelper->ScanImage((LPCTSTR)csImageFile);
 	ULONGLONG ullEnd = SP::Module::Comm::RVCGetTickCount();
 	if (ISSUCCEEDED(erroCode)) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::ScanImage").setCostTime(ullEnd - ullStart)("DevAdapter::ScanImage succ");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::ScanImage").setCostTime(ullEnd - ullStart)("ScanImage succ");
 		///*TODO:  (80374374@2/20/2024)*/
 		if (!ResizeImage(csImageFile, m_dwMaxImageSize)) {
 			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setResultCode(MapCode2RTAString(LOG_WARN_HSPS_RESIZE_IMAGE_FILE_FAILED)).setAPI(__FUNCTION__)("HSPScanner resize image failed");
@@ -1705,11 +1699,11 @@ int CHSPScannerFSM::ScanImage(SpReqAnsContext<HSPScannerService_ScanImage_Req,
 				ErrorCodeEnum eHide = m_hDevHelper->SetParam(HSPS_MODEL_VIEW, HSPS_VIEW_HIDE);
 				ullEnd = SP::Module::Comm::RVCGetTickCount();
 				if (ISSUCCEEDED(eHide)) {
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::SetParam").setCostTime(ullEnd - ullStart)("Hide Preview Dialog");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::SetParam").setCostTime(ullEnd - ullStart)("HSPS_MODEL_VIEW::HSPS_VIEW_HIDE");
 					nRes = 6;
 				} else {
 					//RTA2N0Q
-					SetErrorAndLog(eHide, MEC_DEVAPI_HSPSCANNER_SetParam, "DevAdapter::SetParam", __FUNCTION__, IsInBusiness(), ullEnd - ullStart, HSPScannerService_LogCode_ScanImage, CombineJsonContext("HSPS_VIEW_HIDE"));
+					SetErrorAndLog(eHide, MEC_DEVAPI_HSPSCANNER_SetParam, "DevAdapter::SetParam", __FUNCTION__, IsInBusiness(), ullEnd - ullStart, HSPScannerService_LogCode_ScanImage, CombineJsonContext("HSPS_MODEL_VIEW::HSPS_VIEW_HIDE"));
 				}
 				/** 拍照成功虽然隐藏了但没有关闭灯  [Gifur@2025325]*/
 			}
@@ -1796,10 +1790,10 @@ int CHSPScannerFSM::ScanImageEx(SpReqAnsContext<HSPScannerService_ScanImageEx_Re
 			ErrorCodeEnum eHide = m_hDevHelper->SetParam(HSPS_MODEL_VIEW, HSPS_VIEW_HIDE);
 			ullEnd = SP::Module::Comm::RVCGetTickCount();
 			if (ISSUCCEEDED(eHide)) {
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::SetParam").setCostTime(ullEnd - ullStart)("Hide Preview Dialog");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::SetParam").setCostTime(ullEnd - ullStart)("HSPS_MODEL_VIEW::HSPS_VIEW_HIDE");
 				nRes = 6;
 			} else {
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI("DevAdapter::SetParam").setCostTime(ullEnd - ullStart).setResultCode(MapCode2RTAString(HSPScanner_UserErrorCode_SetParam_Hide))("Hide Preview Dialog failed: %s", SpStrError(eHide));
+				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI("DevAdapter::SetParam").setCostTime(ullEnd - ullStart).setResultCode(MapCode2RTAString(HSPScanner_UserErrorCode_SetParam_Hide))("HSPS_MODEL_VIEW::HSPS_VIEW_HIDE failed: %s", SpStrError(eHide));
 			}
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI(__FUNCTION__).setLogCode(HSPScannerService_LogCode_ScanImageEx)("ScanImageEx ctx: %s, %d.", (LPCTSTR)ctx->Ans.filePath, ctx->Ans.imageData.m_iLength);
 		}
@@ -1884,11 +1878,8 @@ int CHSPScannerFSM::SetWinPos(SpReqAnsContext<HSPScannerService_SetWinPos_Req,
 	}
 	break;
 	}
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("SetWinPos: %s(%d).", ParamValToString(value), value);
 
 	if (bSetCustom) {
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("Start to SetViewPos x(%d), y(%d), w(%d), reserved(%d).",
-			ctx->Req.pointX, ctx->Req.pointY, ctx->Req.nWidth, ctx->Req.reserved4);
 		const ULONGLONG ullStart = SP::Module::Comm::RVCGetTickCount();
 		erroCode = m_hDevHelper->SetViewPos(ctx->Req.pointX, ctx->Req.pointY, ctx->Req.nWidth);
 		const ULONGLONG ullEnd = SP::Module::Comm::RVCGetTickCount();
@@ -2228,7 +2219,7 @@ int CHSPScannerFSM::ScanImageJS(SpReqAnsContext<HSPScannerService_ScanImageJS_Re
 	erroCode = m_hDevHelper->ScanImage((LPCTSTR)csImageFile);
 	ULONGLONG ullEnd = SP::Module::Comm::RVCGetTickCount();
 	if (ISSUCCEEDED(erroCode)) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::ScanImage").setCostTime(ullEnd - ullStart)("DevAdapter::ScanImage succ");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::ScanImage").setCostTime(ullEnd - ullStart)("ScanImage succ");
 		if (ctx->Req.compress > 0 && !ResizeImage(csImageFile, ctx->Req.compress/*KB*/)) {
 			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setResultCode(MapCode2RTAString(LOG_WARN_HSPS_RESIZE_IMAGE_FILE_FAILED)).setAPI(__FUNCTION__).setLogCode(HSPScannerService_LogCode_ScanImageJS).setCostTime(ullEnd - ullStart)("HSPScanner resize image failed");
 			SetLastUserCode(LOG_WARN_HSPS_RESIZE_IMAGE_FILE_FAILED);

+ 6 - 19
Module/mod_ResourceWatcher/ResourceWatcherFSM.cpp

@@ -918,17 +918,13 @@ BOOL ResourceWatcherFSM::DeleteVersionPackage()
                 CSimpleStringA tVerPath;
                 DeleteResult delResult;
                 int nFileCount = 0;
-#ifdef RVC_OS_LINUX
-                tVerPath = verPath + SPLIT_SLASH_STR + (*riter).ToString(); 
-#else
-                tVerPath = verPath + "\\" + (*riter).ToString();
-#endif // RVC_OS_LINUX
+                tVerPath = verPath + SPLIT_SLASH_STR + (*riter).ToString();
                 DeleteParam delParam(tVerPath.GetData());
                 delParam.rtaCode = "RTA5A12";
                 delParam.SetRmDirFlag();//版本文件夹连目录一起清理
                 nFileCount = ProcessFileDelete(delParam, delResult); 
-                DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Delete Version result(%s): count(%d), suc(%d), failed(%d).", 
-                    tVerPath.GetData(), nFileCount, delResult.sucCnt, delResult.failCnt);
+				DbgWithLink(delResult.failCnt > 0 ? LOG_LEVEL_WARN : LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Delete Version result(%s): count(%d), suc(%d), failed(%d).",
+					tVerPath.GetData(), nFileCount, delResult.sucCnt, delResult.failCnt);
                 if (delResult.failCnt > 0)
                 {
                     bFailFlag = true;
@@ -992,8 +988,7 @@ void ResourceWatcherFSM::DeleteVideoFiles()
     delParam.rtaCode = "RTA5A13";
     delParam.saveBackDay = backDays;
     const int nFileCount = ProcessFileDelete(delParam, delResult);
-    DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Delete [Video] result(%s): count(%d), suc(%d), failed(%d).", videoPath.GetData(), nFileCount, delResult.sucCnt, delResult.failCnt);
-
+	DbgWithLink(delResult.failCnt > 0 ? LOG_LEVEL_WARN : LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Delete [Video] result(%s): count(%d), suc(%d), failed(%d).", videoPath.GetData(), nFileCount, delResult.sucCnt, delResult.failCnt);
 }
 
 void ResourceWatcherFSM::SelfTest(EntityTestEnum eTestType,
@@ -1728,7 +1723,6 @@ int ResourceWatcherFSM::InitialAutoStartupSetType()
     spConfig->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "AutoStartCMD", value);
     if (value != 0) {
         ret = value;
-        DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Get AutoStartCMD from CenterSettings: %d", ret);
     }
     return ret;
 }
@@ -2362,10 +2356,7 @@ void ResourceWatcherFSM::DetectAutoStartFileAndWarn()
 		}
         keyset_str += content;
 	}
-
-    //Object2Json(curset_str, curStartupFileInfo);
-	//Object2Json(keyset_str, keyStartFileInfo);
-    LogWarn(Severity_Low, Error_Debug, LOG_RESOURCEWATCHER_DEBUG_STARTUPFILES, curset_str.c_str());
+    //LogWarn(Severity_Low, Error_Debug, LOG_RESOURCEWATCHER_DEBUG_STARTUPFILES, curset_str.c_str());
 	LogWarn(Severity_Low, Error_Debug, LOG_RESOURCEWATCHER_DEBUG_KEY_STARTUPFILES, keyset_str.c_str());
 }
 
@@ -3720,20 +3711,17 @@ void ResourceWatcherFSM::DetectWallpaperAndWarn()
 		if (lResult == ERROR_SUCCESS) {
 			CSimpleStringA strMsg = CSimpleStringA::Format("{\"subject\":\"wallpaper_path\",\"value\":\"%s\"}", szValue);
 			LogWarn(Severity_Low, Error_Debug, LOG_INFO_DESKTOP_WALLPAPER_PATH, strMsg);
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI("WallpaperSettings")(strMsg.GetData());
             regeditValue = szValue;
             wellDone = true;
 		}
 		else {
 			CSimpleStringA strMsg = CSimpleStringA::Format("{\"subject\":\"wallpaper_path\",\"error\":\"RegQueryValueEx for Wallpaper returned %u, GLE=%u\"}", lResult, GetLastError());
 			LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_DESKTOP_WALLPAPER_PATH_FETCHFAILE, strMsg);
-            DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI("WallpaperSettings").setResultCode("RTA5A0E")(strMsg.GetData());
 		}
 	}
 	else {
 		CSimpleStringA strMsg = CSimpleStringA::Format("{\"subject\":\"wallpaper_path\",\"error\":\"RegOpenKeyEx for Desktop returned %u, GLE=%u\"}", lResult, GetLastError());
 		LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_DESKTOP_WALLPAPER_PATH_FETCHFAILE, strMsg);
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI("WallpaperSettings").setResultCode("RTA5A0E")(strMsg.GetData());
 	}
     RegCloseKey(hKey);
     //////////////////////////////////////////////////////////////////////////
@@ -3742,7 +3730,6 @@ void ResourceWatcherFSM::DetectWallpaperAndWarn()
 	int value(0);
     spCtSettingConfig->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "MakeSureCMBWallPaper", value);
 	if (!!value) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Get MakeSureCMBWallPaper active flag from CenterSettings");
         wallpapaerSetCMD = true;
 	}
 
@@ -3874,7 +3861,7 @@ void ResourceWatcherFSM::InitUserInfo()
 	if (bRes)
 	{
 		m_strLoginedUserName = pBuffer;
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Current logined user name:%s", m_strLoginedUserName.GetData());
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Current logined user name:%s", m_strLoginedUserName.GetData());
     }
     else {
 		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("WTSQuerySessionInformation failed, GLE=%u", GetLastError());

+ 0 - 12
Module/mod_ScannerSet/ScannerSetFSM.cpp

@@ -444,9 +444,6 @@ int CScannerFSM::StopPreview(SpReqAnsContext<ScannerService_CancelPreview_Req,
 			CSimpleStringA::Format("CancelPreview context failed: ErrCode:%s, userCode: 0x%08X.", SpStrError(erroCode), dwUserCode));
 		nRes = 1;
 	}
-	else {
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER).setAPI(__FUNCTION__)("CancelPreview context suc.");
-	}
 	return nRes;
 }
 
@@ -543,7 +540,6 @@ int CScannerFSM::SetProperty(SpReqAnsContext<ScannerService_SetProperty_Req,
 	}
 	else {
 		ctx->Ans.retCode = ans.retCode;
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("SetProperty context suc, retCode: ans(%d), ctx(%d).", ans.retCode, ctx->Ans.retCode);
 	}
 	ctx->Answer(erroCode, dwUserCode);
 	return nRes;
@@ -577,10 +573,6 @@ int CScannerFSM::ShowLTProperty(SpReqAnsContext<ScannerService_ShowProperty_Req,
 			nRes = 0;
 		}
 	}
-	else {
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("ShowLTProperty context suc.");
-	}
-
 	ctx->Answer(erroCode, dwUserCode);
 	return nRes;
 }
@@ -619,10 +611,6 @@ int CScannerFSM::SetWinPos(SpReqAnsContext<ScannerService_SetWindowPos_Req,
 		}
 		nRes = 1;
 	}
-	else {
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)("SetWinPos context suc.");
-	}
-
 	ctx->Answer(erroCode, dwUserCode);
 	return nRes;
 }

+ 0 - 2
Module/mod_gpio/GpioFSM.cpp

@@ -935,7 +935,6 @@ void CGPIOFSM::OnEventDetect(void* pData)
 		m_bOpenFlag = true;
 		m_DoorOpenTimeStamp = SP::Module::Comm::RVCGetTickCount();
 		LogEvent(Severity_Middle, LOG_EVT_OPENSENSOR_ON, CSimpleStringA::Format("%s [Active] line: %d", GetDriverPortString(18), __LINE__));
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(GpioService_LogCode_Detect_DoorOpen)("[GPIO] The chassis door is open");
 	}
 	else if (!DetectBit(btInput, OPENSENSOR) && m_bOpenFlag) {
 		m_bOpenFlag = false;
@@ -1012,7 +1011,6 @@ void CGPIOFSM::OnEventDetect(void* pData)
 	if (DetectBit(btInput, CARDGATESENSOR) && !m_bCardGateFlag) {
 		m_bCardGateFlag = true;
 		LogEvent(Severity_Middle, LOG_EVT_CARDGATESENSOR, CSimpleStringA::Format("%s [Active] line: %d", GetDriverPortString(21), __LINE__));
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(GpioService_LogCode_Detect_CardMouseJam)("[GPIO] The card mouse is jam");
 	}
 	else if (!DetectBit(btInput, CARDGATESENSOR) && m_bCardGateFlag) {
 		LogEvent(Severity_Middle, LOG_EVT_CARDGATESENSOR_OFF, CSimpleStringA::Format("%s [InActive] line: %d", GetDriverPortString(21), __LINE__));