Bladeren bron

Z991239-6443 #comment 去除 Notify

80374374 1 maand geleden
bovenliggende
commit
4e64432fe8

+ 1 - 3
Framework/Common/SpBase.h

@@ -72,8 +72,7 @@ enum LogTypeEnum
 	Log_Warning=2,					// Warning
 	Log_Error=3,						// Error notify
 	Log_Debug=4,						// debug alert ec.Assert
-	Log_Fatal = 5,                     // Fatal notify
-	Log_Notify = 6                     //User notify
+	Log_Fatal = 5                     // Fatal notify
 };
 
 /** define the framework internal behavior log */
@@ -1668,7 +1667,6 @@ SPBASE_API void LogFatal(const SeverityLevelEnum eLevel, ErrorCodeEnum dwSysErro
 SPBASE_API void LogAssert(const char *pszMessage,const char *pszSourceFile,const int nLine);
 SPBASE_API void LogTrace(const char *pszMessage,const char *pszSourceFile,const int nLine);
 
-SPBASE_API void LogNotify(const NotifyLevelEnum eLevel, ErrorCodeEnum dwSysErrorCode, DWORD dwUserErrorCode, const char* pszMessage);
 SPBASE_API void LogEvent(const SeverityLevelEnum eLevel, DWORD dwUserEventCode, const char* pszMessage, const linkContext& t_context);
 SPBASE_API void LogError(const SeverityLevelEnum eLevel, ErrorCodeEnum dwSysErrorCode, DWORD dwUserErrorCode, const char* pszMessage, const linkContext& t_context);
 SPBASE_API void LogWarn(const SeverityLevelEnum eLevel, ErrorCodeEnum dwSysErrorCode, DWORD dwUserErrorCode, const char* pszMessage, const linkContext& t_context);

+ 2 - 2
Framework/spbase/CodeSignVerify.cpp

@@ -462,7 +462,7 @@ bool CCodeSignVerify::GetSignCertInfo(HCERTSTORE hStore, PCMSG_SIGNER_INFO pSign
 		}
 
 		// Allocate memory for Issuer name.
-		LPTSTR szName = (LPTSTR)LocalAlloc(LPTR, dwDataLen * sizeof(TCHAR));
+		szName = (LPTSTR)LocalAlloc(LPTR, dwDataLen * sizeof(TCHAR));
 		if (!szName)
 		{
 			SetLastErrMsg("Unable to allocate memory for issuer name");
@@ -646,7 +646,7 @@ bool CCodeSignVerify::GetTimeOfTimeStamp(HCERTSTORE hStore, PCMSG_SIGNER_INFO pS
 
 				// Loop through authenticated attributes and find
 				// szOID_RSA_signingTime OID.
-				for (DWORD n = 0; n < pCounterSignerInfo->AuthAttrs.cAttr; n++)
+				for (n = 0; n < pCounterSignerInfo->AuthAttrs.cAttr; n++)
 				{
 					if (lstrcmpA(szOID_RSA_signingTime,
 						pCounterSignerInfo->AuthAttrs.rgAttr[n].pszObjId) == 0)

+ 0 - 30
Framework/spbase/SpBase.cpp

@@ -261,36 +261,6 @@ SPBASE_API void LogFatal(const SeverityLevelEnum eLevel, ErrorCodeEnum dwSysErro
 		("Fatal: {%s}(sc=0x%X, uc=0x%X)", pszMessage, dwSysErrorCode, dwUserErrorCode);
 }
 
-SPBASE_API void LogNotify(const NotifyLevelEnum eLevel, ErrorCodeEnum dwSysErrorCode, DWORD dwUserErrorCode, const char* pszMessage)
-{
-	SpModule* pModule = GetSpModule();
-	if (pModule) {
-		const SeverityLevelEnum severityLevel = (SeverityLevelEnum)(int)eLevel;
-		pModule->LogMessage(Log_Notify, severityLevel, dwSysErrorCode, dwUserErrorCode, pszMessage);
-	} else {
-		sp_dbg_info("LogNotify failed!can not find the module");
-	}
-    
-	switch (eLevel) {
-	case Notify_Info:
-        DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__).setVtmCode(DWORD2Hex(dwUserErrorCode).GetData())
-            ("Notify: {%s}(sc=0x%X, uc=0x%X)", pszMessage, dwSysErrorCode, dwUserErrorCode);
-		break;
-	case Notify_Warn:
-        DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__).setVtmCode(DWORD2Hex(dwUserErrorCode).GetData())
-            ("Notify: {%s}(sc=0x%X, uc=0x%X)", pszMessage, dwSysErrorCode, dwUserErrorCode);
-		break;
-	case Notify_Error:
-        DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__).setVtmCode(DWORD2Hex(dwUserErrorCode).GetData())
-            ("Notify: {%s}(sc=0x%X, uc=0x%X)", pszMessage, dwSysErrorCode, dwUserErrorCode);
-		break;
-	default:
-        DbgWithLink(LOG_LEVEL_FATAL, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__).setVtmCode(DWORD2Hex(dwUserErrorCode).GetData())
-            ("Notify: {%s}(sc=0x%X, uc=0x%X)", pszMessage, dwSysErrorCode, dwUserErrorCode);
-		break;
-	}
-}
-
 SPBASE_API void LogWarn(const SeverityLevelEnum eLevel, ErrorCodeEnum dwSysErrorCode,DWORD dwUserErrorCode, const char *pszMessage)
 {
 	SpModule *pModule = GetSpModule();

+ 1 - 3
Framework/spbase/SpEntity.cpp

@@ -969,9 +969,7 @@ ErrorCodeEnum SpEntity::LogMessage( const LogTypeEnum LogType, const SeverityLev
 
 	/*存储当前实体最新一条错误信息*/
 	if ((LogType == Log_Warning && (Level == Severity_High || Level == Severity_Middle))
-		|| LogType == Log_Error || LogType == Log_Fatal 
-		|| (LogType == Log_Notify && (Level == Severity_High/* || Level == Severity_Middle*/))
-		) {
+		|| LogType == Log_Error || LogType == Log_Fatal) {
 		SetEntityLastError((ErrorCodeEnum)dwSysErrorCode, dwUserErrorCode, pMessage);
 	}
 

+ 0 - 15
Framework/spshell/log.cpp

@@ -278,21 +278,6 @@ static void on_log(void *inst,
 			notifyType = GUI_DISPLAY_ELEM_LOG_FATAL;
 			msgContent = CSimpleString::Format("[%s] F:{%s}(sc:0x%X, uc:0x%X)", ent->name, msg, log_sys_error, log_usr_error);
 		}
-		else if (log_type == 6) {//Log_Notify
-            notifyType = GUI_DISPLAY_ELEM_NOTIFY_INFO;
-            if (log_severity == 2) {//Notify_Warn
-                notifyType = GUI_DISPLAY_ELEM_NOTIFY_WARN;
-            } else if (log_severity == 3) {
-                notifyType = GUI_DISPLAY_ELEM_NOTIFY_ERROR;
-            }
-#if defined(_MSC_VER)
-			msgContent = CSimpleString::Format("[%s] N:{%s}(sc:0x%X, uc:0x%X)", ent->name, msg, log_sys_error, log_usr_error);
-#else
-			CSimpleStringA strMsg = CSimpleStringA::Format("%s V%d.%d.%d", ent->name, ent->version.major, ent->version.minor, ent->version.revision);
-			strMsg += ":][:"; /** arrange with QtGUIConsole to split entity name and msg content [Gifur@202133]*/
-			msgContent = CSimpleString::Format("%s%s", strMsg.GetData(), msg);
-#endif //_MSC_VER
-		}
 
 		if (notifyType != 0) {
 #if defined(_MSC_VER)

+ 1 - 1
Module/mod_chromium/CModTools.cpp

@@ -1150,7 +1150,7 @@ namespace Chromium {
 			CSimpleString runningVer = "";
 			m_pEntity->GetFunction()->GetRunningVersion(runningVer);
 			dstInstallUrl.append("?terminalVersion=").append(runningVer.GetData());
-			//TODO: CrossPlaform  [Gifur@2025730]
+			//TODO: CrossPlaform  考虑采用 SpUtility.h 中的 replaceInPlace 函数 [Gifur@2025730]
 #if defined(RVC_OS_LINUX)
 			auto replaceAll = [](std::string& str, const std::string& search, const std::string& replace) {
 				size_t pos = 0;

+ 2 - 20
Module/mod_chromium/mod_chromium.cpp

@@ -531,15 +531,6 @@ namespace Chromium {
 	{
 		LogManager::getInstance().logEntityStageChange("OnPreStart_register", 0, "begin");
 		ErrorCodeEnum Error;
-
-		//TODO: CrossPlaform  [Gifur@2025730]
-#if defined(RVC_OS_LINUX)
-        Error = GetFunction()->SubscribeLog(m_uuidAllFault, this, Log_Notify, Severity_High, Error_IgnoreAll, -2, NULL, false);
-        if (Error_Succeed != Error) {
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("subscribe log for notify failed! %s", SpStrError(Error));
-        }
-#endif //RVC_OS_LINUX
-
 		if (!ConfigManager::getInstance().m_withBrowser)
 		{
 			if (Error_Succeed == (Error = GetFunction()->SubscribeLog(m_uuidAccessAuth, this, Log_Event, Severity_None, Error_IgnoreAll, -1, "AccessAuthorization")))
@@ -790,16 +781,9 @@ namespace Chromium {
 					return false;
 				}
 				path = csHardwareCfg + SPLIT_SLASH_STR + "root.ini";
-				//TODO: CrossPlaform  [Gifur@2025730]
-#if defined(RVC_OS_WIN)
-				if (_access(path.GetData(), 0) == 0) {
-#else
-				if (access(path.GetData(), F_OK) == 0) {
-#endif
+				if (ExistsFileA(path)) {
 					return true;
-				}
-				else
-				{
+				} else {
 					DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM)("root.ini(%s) is not exist.", path.GetData());
 					return false;
 				}
@@ -808,8 +792,6 @@ namespace Chromium {
 			//if root.ini not exist
 			CSimpleString rootIni_path;
 			ConfigManager::getInstance().m_existRootIni = IsRootINIExist(rootIni_path);
-			
-
 
 			//the system info may be not complete.If the device is not install ,it can't not read the terminalNo.
 			CSystemStaticInfo t_sysInfo;