瀏覽代碼

Z991239-6346 #comment 媒体相关日志精简

80274480 2 月之前
父節點
當前提交
27f908f42e

+ 6 - 6
Module/mod_SalesRecorder/mod_SalesRecorder.cpp

@@ -582,10 +582,10 @@ int CSalesRecorderEntity::GetRecordCamera()
 	}
 	else {
 		if (0 == iRecordCamera) {
-			LogWarn(Severity_Low, Error_Debug, LOG_EVT_SALESRECORD_USE_ENVCAMERA, "remote video record use env camera.");
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("remote video record use env camera.");
 		}
 		else {
-			LogWarn(Severity_Low, Error_Debug, LOG_EVT_SALESRECORD_USE_OPTCAMERA, "remote video record use opt camera.");
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("remote video record use opt camera.");
 		}
 	}
 
@@ -631,7 +631,7 @@ void CSalesRecorderEntity::OnRecordEntityExcption()
 
 void CSalesRecorderEntity::OnRecordFinished()
 {
-	LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORD_FINISHED, "现场销售双录已完成.");
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("现场销售双录已完成.");
 }
 
 
@@ -942,7 +942,7 @@ ErrorCodeEnum CSalesRecorderEntity::SaveVideo( const char * videofilename)
 						unsigned long ufilesize = GetFileSize(sourFileName.GetData());
 						char strhash[MAX_PATH] = { 0 };
 						get_file_sm3digest(strhash, MAX_PATH, sourFileName.GetData());
-						LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORD_FILEINFO, CSimpleStringA::Format("%s file size is %u byte,sm3 digest is %s.", sourFileName.GetData(), ufilesize, strhash).GetData());
+						DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s file size is %u byte,sm3 digest is %s.", sourFileName.GetData(), ufilesize, strhash);
 						bRet = rvcMoveFile(sourFileName.GetData(), destFileName.GetData());
 						if (!bRet) {
 							ErrorCode = Error_NotImpl;
@@ -967,7 +967,7 @@ ErrorCodeEnum CSalesRecorderEntity::SaveVideo( const char * videofilename)
 					}
 
 					if (bMoveSucc) {
-						LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORD_SAVED_SUCCESS, CSimpleStringA::Format("succeed to save sales video, move it from %s to %s.", sourFileName.GetData(), destFileName.GetData()).GetData());
+						DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("succeed to save sales video, move it from %s to %s.", sourFileName.GetData(), destFileName.GetData());
 					}
 				}
 			}
@@ -1149,7 +1149,7 @@ ErrorCodeEnum CSalesRecorderEntity::HandleStartRecord(const char *pszMessage, co
 
 	StartRecord(m_SalesVideoName, 90, &subtitleParam, m_bWholeSection, false, eRecordType);
 
-	LogWarn(Severity_Low, Error_Debug, LOG_EVT_START_REMOTERECORD, CSimpleStringA::Format("start remote record %s.", m_SalesVideoName).GetData());
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start remote record %s.", m_SalesVideoName));
 
 	return Error;
 }

+ 16 - 16
Module/mod_counterconnector/ConnectorFSM.cpp

@@ -164,7 +164,7 @@ ErrorCodeEnum ACMCallFSM::OnInit()
 	int iCount = 0;
 
 	if (Error != Error_Succeed) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("on_error");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("on_error");
 		FSMEvent* e = new FSMEvent(USER_EVT_ERROR);
 		PostEventFIFO(e); // jump to error state
 		return Error;
@@ -173,7 +173,7 @@ ErrorCodeEnum ACMCallFSM::OnInit()
 	GetEntityBase()->GetFunction()->SetSysVar("CallState", "O"); // set to offline state 
 	Error = LoadTerminalId();
 	if (Error != Error_Succeed) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("on_error");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("on_error");
 		FSMEvent* e = new FSMEvent(USER_EVT_ERROR);
 		PostEventFIFO(e); // jump to error state
 		return Error;
@@ -329,7 +329,7 @@ int ACMCallFSM::GetCallRouteList()
 			http_callinfo.strAddClientLevel = NULL;
 		}
 
-		LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_CALL_QUEUE_INFO, CSimpleStringA::Format("call type is %d, http call route queue name is %s, and client level is %s.", m_CallingParam.nCallType, http_callinfo.strQueueName.GetData(), http_callinfo.strAddClientLevel.GetData()).GetData());
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("call type is %d, http call route queue name is %s, and client level is %s.", m_CallingParam.nCallType, http_callinfo.strQueueName.GetData(), http_callinfo.strAddClientLevel.GetData());
 
 		http_callinfo.strTerminalNo = m_strTerminalId;
 
@@ -550,7 +550,7 @@ int ACMCallFSM::LogFailedWarns(int iFailedCode, const char* strmsg)
 {
 	int iRet = 0;
 	if (m_bHangup){
-		LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_FAILED_USER_HANGUP, strmsg);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s",strmsg);
 	}
 	else{
 		switch (iFailedCode) {
@@ -635,13 +635,13 @@ void ACMCallFSM::OnStateTrans(int iSrcState, int iDstState)
 					//LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_BROADCAST_CALL_STATE, strmsg);
 				} 
 				else{
-					LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_AUTO_RECONNECT,CSimpleString::Format("state from %d to %d, auto reconnect, not broadcast state to ui.", st1, st2).GetData());
+					DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(CSimpleString::Format("state from %d to %d, auto reconnect, not broadcast state to ui.", st1, st2).GetData());
 					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402304C5")("system auto reconnect.");
 				}
 
 				if (eState_HandFree == st2 || eState_Pickup == st2){
 					if (eState_Connecting == st1){
-						LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_CONNECT_SUCCESS, "connect success!");
+						DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("connect success!");
 					}
 				}
 			}
@@ -696,13 +696,13 @@ unsigned int ACMCallFSM::s0_on_event(FSMEvent* event)
 	if (event->iEvt == USER_EVT_PICKUP_CALL) 
 	{
 		memset(&m_CallingParam,0,sizeof(m_CallingParam));  //正常呼叫
-		LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_PICKUPCALL,"begin pickup call");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("begin pickup call");
 		m_nStarttime = y2k_time_now();
 	} 
 	else if (event->iEvt == USER_EVT_HANDFREE_CALL) 
 	{
 		memset(&m_CallingParam,0,sizeof(m_CallingParam));							// 正常呼叫
-		LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_HANDFREECALL,"begin hand free call");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("begin hand free call");
 		m_nStarttime = y2k_time_now();
 	}
 	else if (event->iEvt == USER_EVT_ASSISTCHAN_IDEL)
@@ -749,7 +749,7 @@ unsigned int ACMCallFSM::s0_on_event(FSMEvent* event)
 	else if (event->iEvt == USER_EVT_DOUBLE_RECORD_CALL)
 	{
 		m_CallingParam.nCallType = DOUBLERECORD_CALLTYPE;
-		LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_DOUBLERECORDCALL,"begin double record call");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("begin double record call");
 		m_nStarttime = y2k_time_now();
 	}
 	else if (event->iEvt == USER_EVT_STOPLOACALREMOTEVIDEO) 
@@ -861,7 +861,7 @@ void ACMCallFSM::s11_on_entry()
 {
 	m_LastSipError = Error_Succeed;
 
-	LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_MAKECALL,"begin make call");
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("begin make call");
 	m_uConnectTime = y2k_time_now();
 	m_bConnected = false;
 
@@ -946,7 +946,7 @@ unsigned int ACMCallFSM::s11_on_event(FSMEvent* event)
 	if (event->iEvt == USER_EVT_HANGUP)
 	{
 		m_bHangup = true;
-		LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_COUNTERCONNECT_SIPCONNECT_HANGUP, CSimpleStringA::Format("sip connecting, customer active hangup after %ds.", y2k_time_now()- m_nStarttime).GetData());
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("sip connecting, customer active hangup after %ds.", y2k_time_now()- m_nStarttime);
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402304C6")("connect failed for user hangup");
 	}
 	else if (event->iEvt == USER_EVT_SIP_STATE_IDLE) 
@@ -1424,7 +1424,7 @@ void ACMCallFSM::s3_on_entry()
 	if (false == m_bConnected) {
 		m_bConnected = true;
 		unsigned int unowtime = y2k_time_now();
-		LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_CALL_CONNECTING_TIME, CSimpleStringA::Format("handfree call connecting time is %us.", unowtime - m_uConnectTime).GetData());
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("handfree call connecting time is %us.", unowtime - m_uConnectTime);
 		m_uConnectTime = unowtime;
 	}
 }
@@ -1476,7 +1476,7 @@ void ACMCallFSM::s4_on_entry()
 	if (false == m_bConnected) {
 		m_bConnected = true;
 		unsigned int unowtime = y2k_time_now();
-		LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_CALL_CONNECTING_TIME, CSimpleStringA::Format("pickup call connecting time is %us.", unowtime - m_uConnectTime).GetData());
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("pickup call connecting time is %us.", unowtime - m_uConnectTime);
 		m_uConnectTime = unowtime;
 	}
 }
@@ -1547,7 +1547,7 @@ void ACMCallFSM::s51_on_entry()
 {
 	if (m_bConnected) {
 		m_bConnected = false;
-		LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_CALL_CONNECT_TIME, CSimpleStringA::Format("call connected time is %us.", y2k_time_now() - m_uConnectTime).GetData());
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("call connected time is %us.", y2k_time_now() - m_uConnectTime);
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setCostTime(SP::Module::Comm::RVCGetTickCount() - m_lConnectCostTime).setLogCode("QLR0402304C4")("disconnect the video connection.");
 	}
 }
@@ -1567,7 +1567,7 @@ void ACMCallFSM::s52_on_entry()
 	ScheduleTimer(52,RELEASEING_SIP_TIMER);
 	if (m_bConnected) {
 		m_bConnected = false;
-		LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_CALL_CONNECT_TIME, CSimpleStringA::Format("call connected time is %us.", y2k_time_now() - m_uConnectTime).GetData());
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("call connected time is %us.", y2k_time_now() - m_uConnectTime);
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setCostTime(SP::Module::Comm::RVCGetTickCount() - m_lConnectCostTime).setLogCode("QLR0402304C4")("disconnect the video connection.");
 	}
 }
@@ -1652,7 +1652,7 @@ void ACMCallFSM::s60_on_entry()
 	HangupCall();
 	if (m_bConnected) {
 		m_bConnected = false;
-		LogWarn(Severity_Low, Error_Debug, LOG_WARN_COUNTERCONNECT_CALL_CONNECT_TIME, CSimpleStringA::Format("call connected time is %us.", y2k_time_now() - m_uConnectTime).GetData());
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("call connected time is %us.", y2k_time_now() - m_uConnectTime);
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setCostTime(SP::Module::Comm::RVCGetTickCount() - m_lConnectCostTime).setLogCode("QLR0402304C4")("disconnect the video connection.");
 	}
 }

+ 4 - 4
Module/mod_counterconnector/mod_counterconnector.cpp

@@ -133,7 +133,7 @@ ErrorCodeEnum CCounterConnectorEntity::ConnectAssistChannel()
 	
 	ErrorCodeEnum Error = m_pCounterConnectorChannel->Connect();
 	if (Error != Error_Succeed) {
-		LogWarn(Severity_Low, Error_Debug, EVENT_MOD_CONNECT_ASSIST_ERROR, "connect assistant channel error");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("connect assistant channel error");
 #ifdef RVC_OS_WIN
 		m_pCounterConnectorChannel->SafeDelete();
 #endif
@@ -315,7 +315,7 @@ void CCounterConnectorEntity ::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUI
 			}
 			CSimpleStringA strValue;
 			GetFunction()->GetSysVar("CallState", strValue);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("摘机,and CallState is %s.", strValue.GetData());
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("摘机,and CallState is %s.", strValue.GetData());
 			HandlePickUpMicroPhoneEvent(1, "pick up microphone.");
 		}
 		break;
@@ -328,7 +328,7 @@ void CCounterConnectorEntity ::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUI
 			}
 			CSimpleStringA strValue;
 			GetFunction()->GetSysVar("CallState", strValue);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("挂机,and CallState is %s.", strValue.GetData());
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("挂机,and CallState is %s.", strValue.GetData());
 			HandlePickUpMicroPhoneEvent(0, "hang up microphone.");
 		}
 		break;
@@ -336,7 +336,7 @@ void CCounterConnectorEntity ::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUI
 		{
 			bool brenderstate = m_fsm.IsCameraRenderState();
 			if (m_bHasLaunched && !brenderstate){
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("提机呼叫");
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("提机呼叫");
 				HandlePickUpCallEvent();
 			}
 			else{

+ 15 - 15
Module/mod_initiativetransfer/FlowControlFSM.cpp

@@ -178,12 +178,12 @@ unsigned int CFlowControlFSM::s0_on_event(FSMEvent* event)
 		AgentFlowResult evt;
 		evt.error = Error_NetBroken;
 		SpSendBroadcast(m_pEntity->GetFunction(), SP_MSG_OF(AgentFlowResult), SP_MSG_SIG_OF(AgentFlowResult), evt);
-		LogWarn(Severity_Low, Error_Debug, LOG_ERR_S0_ANSACMFLOW, "s0 receive ANSACMFLOW");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s0 receive ANSACMFLOW");
 	} else if (event->iEvt == USER_EVT_REQAGENTFLOW) {
 		AgentFlowResult evt;
 		evt.error = Error_NetBroken;
 		SpSendBroadcast(m_pEntity->GetFunction(), SP_MSG_OF(AgentFlowResult), SP_MSG_SIG_OF(AgentFlowResult), evt);
-		LogWarn(Severity_Low, Error_Debug, LOG_ERR_S0_REQAGENTFLOW, "s0 receive REQAGENTFLOW");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s0 receive REQAGENTFLOW");
 	}
 	else if (event->iEvt == USER_EVT_ASSIS_IDEL)
 	{
@@ -218,7 +218,7 @@ unsigned int CFlowControlFSM::s1_on_event(FSMEvent* event)
 		} 
 		else {
 			Error = Error_NetBroken;
-			LogWarn(Severity_Low, Error_Debug, LOG_ERR_S1_REQAGENTFLOW_FAILED, "s1 receive REQAGENTFLOW but chan is off.");
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s1 receive REQAGENTFLOW but chan is off.");
 		}
 		return Error == Error_Succeed ? 1 : 0;
 	} 
@@ -229,7 +229,7 @@ unsigned int CFlowControlFSM::s1_on_event(FSMEvent* event)
 	}
 	else if (event->iEvt == USER_EVT_ASSIS_IDEL)
 	{
-		LogWarn(Severity_Low, Error_Debug, LOG_ERR_S1_ASSIS_IDEL, "s1 ASSIS_IDEL.");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s1 ASSIS_IDEL.");
 		if (Error_Succeed == ConnectToAssistchan(false)) {
 			m_bConnectAssit = true;
 		}
@@ -244,7 +244,7 @@ unsigned int CFlowControlFSM::s2_on_event(FSMEvent* event)
 		AgentFlowResult evt;
 		evt.error = Error_NetBroken;
 		SpSendBroadcast(m_pEntity->GetFunction(), SP_MSG_OF(AgentFlowResult), SP_MSG_SIG_OF(AgentFlowResult), evt);
-		LogWarn(Severity_Low, Error_Debug, LOG_ERR_S2_CHAN_OFF, "s2 chan off.");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s2 chan off.");
 	} 
 	else if (event->iEvt == USER_EVT_ANSAGENTFLOW) {
 		AnsAgentFlowEvent *afe = static_cast<AnsAgentFlowEvent*>(event);
@@ -257,7 +257,7 @@ unsigned int CFlowControlFSM::s2_on_event(FSMEvent* event)
 #endif //RVC_OS_WIN
 		evt.error = afe->err ? Error_Unexpect : Error_Succeed;
 		if (evt.error != Error_Succeed){
-			LogWarn(Severity_Low, Error_Debug, LOG_ERR_S2_ANSAGENTFLOW_FAILED, "s2 receive ANSAGENTFLOW error.");
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s2 receive ANSAGENTFLOW error.");
 		}
 		SpSendBroadcast(m_pEntity->GetFunction(), SP_MSG_OF(AgentFlowResult), SP_MSG_SIG_OF(AgentFlowResult), evt);
 	}
@@ -275,11 +275,11 @@ unsigned int CFlowControlFSM::s2_on_event(FSMEvent* event)
 	else if (event->iEvt == USER_EVT_NTFENTFLOW) {
 		ErrorCodeEnum result = DisallowControl();
 		if (result != Error_Succeed){
-			LogWarn(Severity_Low, Error_Debug, LOG_ERR_S2_NTFENTFLOW_FAILED, "s2 send NTFENTFLOW error.");
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s2 send NTFENTFLOW error.");
 		}
 	}
 	else if (event->iEvt == USER_EVT_ASSIS_IDEL){
-		LogWarn(Severity_Low, Error_Debug, LOG_ERR_S2_ASSIS_IDEL, "s2 ASSIS_IDEL.");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s2 ASSIS_IDEL.");
 		if (Error_Succeed == ConnectToAssistchan(false)) {
 			m_bConnectAssit = true;
 		}
@@ -320,7 +320,7 @@ unsigned int CFlowControlFSM::s3_on_event(FSMEvent* event)
 		} 
 		else {
 			Error = Error_NetBroken;
-			LogWarn(Severity_Low, Error_Debug, LOG_ERR_S3_ANSACMFLOW_FAILED, "s3 send ANSACMFLOW error.");
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s3 send ANSACMFLOW error.");
 		}
 		return Error == Error_Succeed ? 1 : 0;
 	} 
@@ -328,11 +328,11 @@ unsigned int CFlowControlFSM::s3_on_event(FSMEvent* event)
 		AgentFlowResult evt;
 		evt.error = Error_NetBroken;
 		SpSendBroadcast(m_pEntity->GetFunction(), SP_MSG_OF(AgentFlowResult), SP_MSG_SIG_OF(AgentFlowResult), evt);
-		LogWarn(Severity_Low, Error_Debug, LOG_ERR_S3_CHAN_OFF, "s3 chan off.");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s3 chan off.");
 	}
 	else if (event->iEvt == USER_EVT_ASSIS_IDEL)
 	{
-		LogWarn(Severity_Low, Error_Debug, LOG_ERR_S3_ASSIS_IDEL, "s3 ASSIS_IDEL.");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s3 ASSIS_IDEL.");
 		if (Error_Succeed == ConnectToAssistchan(false)) {
 			m_bConnectAssit = true;
 		}
@@ -351,7 +351,7 @@ unsigned int CFlowControlFSM::s5_on_event(FSMEvent* event)
 	if (event->iEvt == USER_EVT_DISCTRL) {
 		ErrorCodeEnum result = DisallowControl();
 		if (result != Error_Succeed) {
-			LogWarn(Severity_Low, Error_Debug, LOG_ERR_S5_DISCTRL_FAILED, "s5 send DISCTRL error.");
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s5 send DISCTRL error.");
 		}
 	}
 	else if (event->iEvt == USER_EVT_REQAGENTFLOW) {
@@ -376,13 +376,13 @@ unsigned int CFlowControlFSM::s5_on_event(FSMEvent* event)
 		}
 		else {
 			Error = Error_NetBroken;
-			LogWarn(Severity_Low, Error_Debug, LOG_ERR_S5_REQAGENTFLOW_FAILED, "s5 send REQAGENTFLOW error.");
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s5 send REQAGENTFLOW error.");
 		}
 		return Error == Error_Succeed ? 1 : 0;
 	}
 	else if (event->iEvt == USER_EVT_ASSIS_IDEL)
 	{
-		LogWarn(Severity_Low, Error_Debug, LOG_ERR_S5_ASSIS_IDEL, "s5 ASSIS_IDEL.");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s5 ASSIS_IDEL.");
 		if (Error_Succeed == ConnectToAssistchan(false)) {
 			m_bConnectAssit = true;
 		}
@@ -392,7 +392,7 @@ unsigned int CFlowControlFSM::s5_on_event(FSMEvent* event)
 
 void CFlowControlFSM::s7_on_entry()
 {
-	LogWarn(Severity_Low, Error_Debug, LOG_ERR_S7_ENTRY, "s7 ENTRY.");
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("s7 ENTRY.");
 }
 
 unsigned int CFlowControlFSM::s7_on_event(FSMEvent* event)

+ 2 - 6
Module/mod_interactivecontrol/mod_interactivecontrol.cpp

@@ -2264,7 +2264,6 @@ void UIServiceSession::Handle_VideoAppendWaterMark(SpReqAnsContext<UIService_Vid
 		ErrorCodeEnum Error = m_pEntity->AppendWaterMark(ctx->Req.videoName, ctx->Req.appendstr);
 		ctx->Answer(Error);
 		if (Error_Succeed == Error) {
-			LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORD_APPEND_WATERMARK_SUCCESS, "record append water mark success!");
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040230BZ70501")("record append water mark success.");
 		}
 	}
@@ -2288,7 +2287,6 @@ void UIServiceSession::Handle_StartRemoteRecord(SpReqAnsContext<UIService_StartR
 				ctx->Ans.ErrorCode = 0;
 				ctx->Ans.ErrorMsg = CSimpleStringA2W("");
 				m_pEntity->m_bSalesRecording = true;
-				LogWarn(Severity_Low, Error_Debug, LOG_EVT_START_REMOTERECORD_SUCCESS, "start remote record success!");
 				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040230BZ70101")("start remote record success.");
 			}
 			else {
@@ -2321,7 +2319,6 @@ void UIServiceSession::Handle_StartRemoteRecord(SpReqAnsContext<UIService_StartR
 				ctx->Ans.ErrorCode = 0;
 				ctx->Ans.ErrorMsg = CSimpleStringA2W("");
 				m_pEntity->m_bSalesRecording = true;
-				LogWarn(Severity_Low, Error_Debug, LOG_EVT_START_REMOTERECORD_SUCCESS, "start remote record success!");
 				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040230BZ70101")("start remote record success.");
 			}
 			else {
@@ -2364,13 +2361,12 @@ void UIServiceSession::Handle_StopRemoteRecord(SpReqAnsContext<UIService_StopRem
 		ErrorCodeEnum Error = m_pEntity->StopRecord(CSimpleStringW2A(ctx->Req.content));
 		ctx->Answer(Error);
 		if (Error_Succeed == Error) {
-			LogWarn(Severity_Low, Error_Debug, LOG_EVT_STOP_REMOTERECORD_SUCCESS, "stop remote record success!");
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040230BZ70201")("stop remote record success.");
 		}
 	}
 	else {
 		ctx->Answer(Error_DevNotAvailable);
-		LogWarn(Severity_Low, Error_Debug, LOG_EVT_CALL_STOP_REMOTERECORD_MULTITIMES, "call stop remote record multitimes!");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("call stop remote record multitimes!");
 	}
 }
 
@@ -2524,7 +2520,7 @@ void UIServiceSession::Handle_StopPlayNotice(SpReqAnsContext<UIService_StopPlayN
 		}
 		else {
 			ctx->Answer(Error_DevNotAvailable);
-			LogWarn(Severity_Low, Error_Debug, LOG_EVT_CALL_STOP_NOTICEPLAY_MULTITIMES, "call stop notice play multitimes!");
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("call stop notice play multitimes!");
 		}
 	}
 }

+ 7 - 7
Module/mod_livenessdetection/RvcWsServer.cpp

@@ -425,7 +425,7 @@ namespace LivenessDetection {
 			m_bstarttrans = false;
 
 			unsigned int utranstime = y2k_time_now() - m_utranstime;
-			LogWarn(Severity_Low, Error_Debug, LOG_EVT_STOPVIDEOTRANS, CSimpleStringA::Format("stop video trans for session close, and transmit time is %us.", utranstime).GetData());
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("stop video trans for session close, and transmit time is %us.", utranstime);
 
 			if (RVC_MIN_VIDEO_TRANS_TIME >= utranstime) {
 				LogWarn(Severity_Middle, Error_Debug, LOG_EVT_AUTO_FACE_FAILED, CSimpleStringA::Format("auto face failed and transmit time is %us.", utranstime).GetData());
@@ -433,7 +433,7 @@ namespace LivenessDetection {
 			}
 
 			if (RVC_MAX_VIDEO_TRANS_TIME <= utranstime) {
-				LogWarn(Severity_Low, Error_Debug, LOG_EVT_AUTO_FACE_TIMEOUT, CSimpleStringA::Format("auto face timeout and transmit time is %us.", utranstime).GetData());
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("auto face timeout and transmit time is %us.", utranstime);
 				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA3E05")("流媒体传输时长不小于15秒.");
 			}
 		}
@@ -519,7 +519,7 @@ namespace LivenessDetection {
 		}
 
 		iRet = 0;
-		LogWarn(Severity_Low, Error_Debug, LOG_EVT_STARTVIDEOTRANS, "start video trans.");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start video trans.");
 		m_utranstime = y2k_time_now();
 
 		return iRet;
@@ -551,15 +551,15 @@ namespace LivenessDetection {
 #endif //RVC_OS_WIN
 
 			unsigned int utranstime = y2k_time_now() - m_utranstime;
-			LogWarn(Severity_Low, Error_Debug, LOG_EVT_STOPVIDEOTRANS, CSimpleStringA::Format("stop video trans for user operation, and transmit time is %us.", utranstime).GetData());
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("stop video trans for user operation, and transmit time is %us.", utranstime);
 
 			if (RVC_MIN_VIDEO_TRANS_TIME >= utranstime) {
-				LogWarn(Severity_Middle, Error_Debug, LOG_EVT_AUTO_FACE_FAILED, CSimpleStringA::Format("auto face failed and transmit time is %us.", utranstime).GetData());
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("auto face failed and transmit time is %us.", utranstime);
 				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA3E04")("流媒体传输时长不大于2秒.");
 			}
 
 			if (RVC_MAX_VIDEO_TRANS_TIME <= utranstime) {
-				LogWarn(Severity_Low, Error_Debug, LOG_EVT_AUTO_FACE_TIMEOUT, CSimpleStringA::Format("auto face timeout and transmit time is %us.", utranstime).GetData());
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("auto face timeout and transmit time is %us.", utranstime);
 				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA3E05")("流媒体传输时长不小于15秒.");
 			}
 		}
@@ -572,7 +572,7 @@ namespace LivenessDetection {
 
 	int RvcWsServer::StartVideoCapTransmit()
 	{
-		LogWarn(Severity_Low, Error_Debug, LOG_EVT_STARTVIDEOCAPTURE, "start video capture transmit.");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start video capture transmit.");
 		return on_send(this, eCapture_Type);
 	}
 

+ 3 - 1
Module/mod_mediacontroller/Event.h

@@ -117,4 +117,6 @@
 #define LOG_WARN_ALLCAMERA_ERRORS								0x208A0002	//摄像头都故障
 #define LOG_WARN_ENVCAMERA_ERROR								0x208A0003	//上摄像头故障
 #define LOG_WARN_OPTCAMERA_ERROR								0x208A0004	//下摄像头故障
-#define LOG_ERROR_ENTITY_ALLOC_MEM_FAILED						0x208A0005	//实体分配内存失败
+#define LOG_ERROR_ENTITY_ALLOC_MEM_FAILED						0x208A0005	//实体分配内存失败
+#define LOG_INFO_KERNEL_VERSION									0x208B0009	//机器内核版本信息
+#define LOG_INFO_UNEXPECTED_KERNEL_VERSION						0x208B000A	//与预期不符的内核版本信息

+ 28 - 28
Module/mod_mediacontroller/capture.cpp

@@ -1594,7 +1594,7 @@ namespace MediaController {
 					else
 					{
 						cap->opt_video->ustarttime = y2k_time_now();
-						LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_OPTCAM_OPEN, "start optcam success.");
+						DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start optcam success.");
 						return Error_EnvCamera;
 					}
 				}
@@ -1607,7 +1607,7 @@ namespace MediaController {
 			else
 			{
 				cap->env_video->ustarttime = y2k_time_now();
-				LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_ENVCAM_OPEN, "start envcam success.");
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start envcam success.");
 				if (cap->opt_video) 
 				{
 					if (cap->env_video) 
@@ -1626,7 +1626,7 @@ namespace MediaController {
 					else
 					{
 						cap->opt_video->ustarttime = y2k_time_now();
-						LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_OPTCAM_OPEN, "start optcam success.");
+						DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start optcam success.");
 						return Error_Succeed;
 					}		
 				}
@@ -1656,7 +1656,7 @@ namespace MediaController {
 				else
 				{
 					cap->opt_video->ustarttime = y2k_time_now();
-					LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_OPTCAM_OPEN, "start optcam success.");
+					DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start optcam success.");
 					return Error_EnvCamera;
 				}
 			}
@@ -1700,7 +1700,7 @@ namespace MediaController {
 			}
 			else{
 				cap->env_video->ustarttime = y2k_time_now();
-				LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_ENVCAM_OPEN, "start envcam success.");
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start envcam success.");
 				return Error_Succeed;
 			}
 		}
@@ -1713,7 +1713,7 @@ namespace MediaController {
 			}
 			else{
 				cap->opt_video->ustarttime = y2k_time_now();
-				LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_OPTCAM_OPEN, "start optcam success.");
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start optcam success.");
 				return Error_Succeed;
 			}
 		}
@@ -1786,7 +1786,7 @@ namespace MediaController {
 				//LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_ENVCAM_CLOSE, CSimpleStringA::Format("stop envcam, and camera open time is %us.", ienvtime).GetData());
 				if (ienvtime >= 1) {
 					float fenvframerate = (float)((float)cap->env_video->frame_id / (float)ienvtime);
-					LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_ENVCAM_FRAME_INFO, CSimpleStringA::Format("env camera frame info is dest frame number is %d(%us), real frame number is %d, difference is %d, real frmerate is %.2ffps.", ienvtime * cap->config.video_env_fps, ienvtime, cap->env_video->frame_id, ienvtime * cap->config.video_env_fps - cap->env_video->frame_id, fenvframerate).GetData());
+					DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("env camera frame info is dest frame number is %d(%us), real frame number is %d, difference is %d, real frmerate is %.2ffps.", ienvtime * cap->config.video_env_fps, ienvtime, cap->env_video->frame_id, ienvtime * cap->config.video_env_fps - cap->env_video->frame_id, fenvframerate);
 				}
 			}
 			video_capture_stop(cap->env_video);
@@ -1797,7 +1797,7 @@ namespace MediaController {
 				//LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_OPTCAM_CLOSE, CSimpleStringA::Format("stop optcam, and camera open time is %us.", iopttime).GetData());
 				if (iopttime >= 1) {	
 					float foptframerate = (float)((float)cap->opt_video->frame_id / (float)iopttime);
-					LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_OPTCAM_FRAME_INFO, CSimpleStringA::Format("opt camera frame info is dest frame number is %d(%us), real frame number is %d, difference is %d, real frmerate is %.2ffps.", iopttime * cap->config.video_opt_fps, iopttime, cap->opt_video->frame_id, iopttime * cap->config.video_opt_fps - cap->opt_video->frame_id, foptframerate).GetData());
+					DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("opt camera frame info is dest frame number is %d(%us), real frame number is %d, difference is %d, real frmerate is %.2ffps.", iopttime * cap->config.video_opt_fps, iopttime, cap->opt_video->frame_id, iopttime * cap->config.video_opt_fps - cap->opt_video->frame_id, foptframerate);
 				}
 			}
 			video_capture_stop(cap->opt_video);
@@ -1887,17 +1887,17 @@ namespace MediaController {
 #ifdef RVC_OS_WIN
 		int n = videocap_get_device_count();
 		for (int i = 0; i < n; ++i) {
-			WCHAR tmp[256];
-			char t[256];
-			WCHAR tmp1[256];
-			char t1[256];
+			WCHAR tmp[MAX_PATH] = {0};
+			char t[MAX_PATH] = { 0 };
+			WCHAR tmp1[MAX_PATH] = { 0 };
+			char t1[MAX_PATH] = { 0 };
 			videocap_get_device_name(i, tmp, ARRAYSIZE(tmp));
 			WideCharToMultiByte(CP_ACP, 0, tmp, -1, t, sizeof(t), 0, NULL);
 			videocap_get_device_path(i, tmp1, ARRAYSIZE(tmp1));
 			WideCharToMultiByte(CP_ACP, 0, tmp1, -1, t1, sizeof(t1), 0, NULL);
 
-			char t2[256];
-			strcpy(t2,t1);
+			char t2[MAX_PATH] = {0};
+			strcpy(t2, t1);
 			for (int j = 0; j < strlen(t2); ++j)
 			{
 				t2[j] = toupper(t2[j]);
@@ -1981,12 +1981,12 @@ namespace MediaController {
 			icamnum = videocap_get_device_count();
 			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("camera count is %d.", icamnum);
 			for (int i = 0; i < icamnum; ++i) {
-				WCHAR tmp[256] = {0};
-				char t[256] = {0};
-				WCHAR tmp1[256] ={0};
-				char t1[256] = {0};
-				WCHAR tmp2[256] = { 0 };
-				char t2[256] = { 0 };
+				WCHAR tmp[MAX_PATH] = {0};
+				char t[MAX_PATH] = {0};
+				WCHAR tmp1[MAX_PATH] ={0};
+				char t1[MAX_PATH] = {0};
+				WCHAR tmp2[MAX_PATH] = { 0 };
+				char t2[MAX_PATH] = { 0 };
 				videocap_get_device_name(i, tmp, ARRAYSIZE(tmp));
 				WideCharToMultiByte(CP_ACP, 0, tmp, -1, t, sizeof(t), 0, NULL);
 				videocap_get_device_path(i, tmp1, ARRAYSIZE(tmp1));
@@ -2018,15 +2018,15 @@ namespace MediaController {
 			rc = audio_get_dev_count(&icnt, &ocnt);
 			if (rc == 0) {
 				int i;
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("audio input devices(%d):", icnt);
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("audio input devices(%d):", icnt);
 				for (i = 0; i < icnt; ++i) {
 					CSimpleStringA str = audio_get_dev_name(true, i);
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%d = %s", i, str.GetData());
+					DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%d = %s", i, str.GetData());
 				}
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("audio output devices(%d):", ocnt);
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("audio output devices(%d):", ocnt);
 				for (i = 0; i < ocnt; ++i) {
 					CSimpleStringA str = audio_get_dev_name(false, i);
-					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%d = %s", i, str.GetData());
+					DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%d = %s", i, str.GetData());
 				}
 			}
 		}
@@ -2041,7 +2041,7 @@ namespace MediaController {
 				char strpath[MAX_PATH] = { 0 };
 
 				if (0 == rvc_videocap_get_device_fullpathname(i, strcamera, 2 * MAX_PATH)){
-					//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%d = %s", inumber, strcamera);
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%d = %s", inumber, strcamera);
 					strCamInfoJson += CSimpleStringA::Format("\"%d\":\"%s\",", inumber, strcamera);
 					inumber++;
 
@@ -2060,7 +2060,7 @@ namespace MediaController {
 #endif // RVC_OS_WIN
 
 		if (icamnum > 0) {
-			LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_CAMERA_COUNT, CSimpleStringA::Format("camera number is %d.", icamnum).GetData());
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("camera number is %d.", icamnum);
 			if (strCamInfoJson.GetLength() > 0) {
 				strCamInfoJson[strCamInfoJson.GetLength() - 1] = '\0';
 			}
@@ -2361,7 +2361,7 @@ namespace MediaController {
 			if (0 != cap->env_video->ustarttime) {
 				int ienvtime = y2k_time_now() - cap->env_video->ustarttime;
 				//LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_ENVCAM_CLOSE, CSimpleStringA::Format("stop envcam, and camera open time is %us.", ienvtime).GetData());
-				LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_ENVCAM_FRAME_INFO, CSimpleStringA::Format("env camera frame info is dest frame number is %d(%us), real frame number is %d, difference is %d.", ienvtime * cap->config.video_env_fps, ienvtime, cap->env_video->frame_id, ienvtime * cap->config.video_env_fps - cap->env_video->frame_id).GetData());
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("env camera frame info is dest frame number is %d(%us), real frame number is %d, difference is %d.", ienvtime * cap->config.video_env_fps, ienvtime, cap->env_video->frame_id, ienvtime * cap->config.video_env_fps - cap->env_video->frame_id);
 			}
 
 			video_capture_destroy(cap->env_video);
@@ -2374,7 +2374,7 @@ namespace MediaController {
 			if (0 != cap->opt_video->ustarttime) {
 				int iopttime = y2k_time_now() - cap->opt_video->ustarttime;
 				//LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_OPTCAM_CLOSE, CSimpleStringA::Format("stop optcam, and camera open time is %us.", iopttime).GetData());
-				LogWarn(Severity_Low, Error_Debug, LOG_EVT_MEDIACONTROLLER_OPTCAM_FRAME_INFO, CSimpleStringA::Format("opt camera frame info is dest frame number is %d(%us), real frame number is %d, difference is %d.", iopttime * cap->config.video_opt_fps, iopttime, cap->opt_video->frame_id, iopttime * cap->config.video_opt_fps - cap->opt_video->frame_id).GetData());
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("opt camera frame info is dest frame number is %d(%us), real frame number is %d, difference is %d.", iopttime * cap->config.video_opt_fps, iopttime, cap->opt_video->frame_id, iopttime * cap->config.video_opt_fps - cap->opt_video->frame_id);
 			}
 
 			video_capture_destroy(cap->opt_video);

+ 1 - 0
Module/mod_mediacontroller/capture.h

@@ -142,6 +142,7 @@ namespace MediaController {
 		Clibvideoqueue *snapshot_shm_queue;
 		Clibvideoqueue *preview_shm_queue;
 		Clibvideoqueue *rtp_shm_queue;
+		
 		capture_t *parent;
 		int camera_type; // CAMERA_TYPE_xxx
 		int frame_id;

+ 30 - 7
Module/mod_mediacontroller/mod_mediacontroller.cpp

@@ -3,6 +3,7 @@
 #include "capture.h"
 #include "Event.h"
 #include "CommEntityUtil.hpp"
+#include "SpUtility.h"
 #include "fileutil.h"
 #include "brightnessinfo.h"
 #include "SpDefine.h"
@@ -51,6 +52,9 @@
 #ifndef RVC_DEFAULT_CAMERA_BRIGHNESS
 #define RVC_DEFAULT_CAMERA_BRIGHNESS 50
 #endif // !RVC_DEFAULT_CAMERA_BRIGHNESS
+#ifndef RVC_DEFAULT_KERNEL_VERSION
+#define RVC_DEFAULT_KERNEL_VERSION "4.19.0-arm64-desktop"
+#endif
 
 #ifdef RVC_OS_WIN
 static void __audio_render_log(audiorender_loglevel elevel, void* user_data, const char* fmt, va_list arg)
@@ -230,6 +234,25 @@ void CMediaControllerEntity::OnPreStart(CAutoArray<CSimpleStringA> strArgs,CSmar
 	pTransactionContext->SendAnswer(Error_Succeed);
 }
 
+#ifdef RVC_OS_WIN
+#else
+static void GetOSKernelVersionInfo()
+{
+	std::string sucContent, failedContent;
+	CSimpleStringA strCmd("uname -r");
+	bool ret = SP::Module::Util::ShellExecute(strCmd.GetData(), sucContent, failedContent);
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("{%s}:{%s}{%s}", strCmd.GetData(), sucContent.c_str(), failedContent.c_str());
+	if (ret) {
+		LogWarn(Severity_Low, Error_Debug, LOG_INFO_KERNEL_VERSION, sucContent.c_str() ? sucContent.c_str() : "get kernel version failed.");
+		if (0 != sucContent.compare(RVC_DEFAULT_KERNEL_VERSION)) {
+			LogWarn(Severity_Low, Error_Debug, LOG_INFO_UNEXPECTED_KERNEL_VERSION, CSimpleStringA::Format("unexpected kernel version %s.", sucContent.c_str() ? sucContent.c_str() : "get kernel version failed.").GetData());
+		}
+	}
+	else {
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("获取系统内核版本信息失败");
+	}
+}
+#endif
 
 void CMediaControllerEntity::OnStarted()
 {
@@ -274,7 +297,7 @@ void CMediaControllerEntity::OnStarted()
 	if (Error == Error_Succeed)
 	{
 		RvcGetAudioDevice();
-		RvcCheckCameraInfo(icamnum);
+		//RvcCheckCameraInfo(icamnum);
 		Error = LoadConfig(&conf);
 		if (Error != Error_Succeed)
 		{
@@ -947,23 +970,23 @@ void CMediaControllerEntity::OnReceivePkt(int sub_type, const char *buffer, int
 				if (eStand2sType == m_eDeviceType) {
 					if (capture_adj_brightness(m_capture, ibrightness, m_nCameraErrorCode) == true){
 						SendCameraBright(eStand2sType);
-						LogWarn(Severity_Low, Error_Debug, LOG_EVT_SET_CAMERA_BRIGHTNESS_INFO, CSimpleStringA::Format("set camera brightness to %d success.", ibrightness).GetData());
+						DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("set camera brightness to %d success.", ibrightness);
 						PostCameraBrightnessInfos(ibrightness);
 					}
 					else{
 						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ACM_SET_CAMERABRIGHT fail!");
-						LogWarn(Severity_Low, Error_Debug, LOG_EVT_SET_CAMERA_BRIGHTNESS_FAILED, CSimpleStringA::Format("set camera brightness to %d failed.", ibrightness).GetData());
+						LogWarn(Severity_Middle, Error_Debug, LOG_EVT_SET_CAMERA_BRIGHTNESS_FAILED, CSimpleStringA::Format("set camera brightness to %d failed.", ibrightness).GetData());
 					}
 				}
 				else {
 					if (0 == capture_set_camera_brightness(ibrightness, m_capture, m_nCameraErrorCode, 0)) {
 						SendCameraBright(eStand1SPlusType);
-						LogWarn(Severity_Low, Error_Debug, LOG_EVT_SET_CAMERA_BRIGHTNESS_INFO, CSimpleStringA::Format("set camera brightness to %d success.", ibrightness).GetData());
+						DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("set camera brightness to %d success.", ibrightness);
 						PostCameraBrightnessInfos(ibrightness);
 					}
 					else {
 						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ACM_SET_CAMERABRIGHT fail!");
-						LogWarn(Severity_Low, Error_Debug, LOG_EVT_SET_CAMERA_BRIGHTNESS_FAILED, CSimpleStringA::Format("set camera brightness to %d failed.", ibrightness).GetData());
+						LogWarn(Severity_Middle, Error_Debug, LOG_EVT_SET_CAMERA_BRIGHTNESS_FAILED, CSimpleStringA::Format("set camera brightness to %d failed.", ibrightness).GetData());
 					}
 				}
 
@@ -1398,7 +1421,7 @@ ErrorCodeEnum CMediaControllerEntity::LoadConfig(capture_config_t *conf)
 			Error = AutoGetVideoDeviceName(conf);
 			CSimpleStringA strInfo = CSimpleStringA::Format("env = %s,opt = %s", conf->strVideoEnv.GetData(), conf->strVideoOpt.GetData());
 			if (Error_Succeed == Error){
-				LogWarn(Severity_Low, Error_Debug, ERROR_MOD_MEDIACONTROLLER_VIDEO_AUTO_MATHED_SUCCESS, strInfo.GetData());
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s", strInfo.GetData());
 			}
 			else {
 				LogWarn(Severity_Middle, Error_Debug, ERROR_MOD_MEDIACONTROLLER_VIDEO_AUTO_MATHED_FAILED, strInfo.GetData());
@@ -2202,7 +2225,7 @@ void CMediaControllerEntity::OnCameraStarted()
 	int ioptbrightness = 0;
 	capture_get_camera_brightness(&ioptbrightness, m_capture, m_nCameraErrorCode, 1);
 
-	//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("current env camera brightness is %d, opt camera brightness is %d.", ienvbrightness, ioptbrightness).GetData());
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("current env camera brightness is %d, opt camera brightness is %d.", ienvbrightness, ioptbrightness);
 }
 
 

+ 2 - 2
Module/mod_recorder/mod_recorder.cpp

@@ -88,7 +88,7 @@ static void LogRecordFileInfo(const char* pszMessage)
 	char strhash[MAX_PATH] = { 0 };
 	get_file_sm3digest(strhash, MAX_PATH, pszMessage);
 
-	LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_VIDEO_INFO, CSimpleStringA::Format("%s file size is %u byte,sm3 digest is %s.", pszMessage, ufilesize, strhash).GetData());
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s file size is %u byte,sm3 digest is %s.", pszMessage, ufilesize, strhash);
 }
 
 static void rvcDbg(filecrypt_loglevel elevel, const char* fmt, ...)
@@ -606,7 +606,7 @@ void CRecorderEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,
 		break;
 
 	case LOG_EVT_UI_RETURNMENU:
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_UI_RETURNMENU event");
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("recv LOG_EVT_UI_RETURNMENU event");
 		break;
 
 	case LOG_EVT_UI_STARTCAMERACAPTURE:

+ 1 - 1
Module/mod_sipphone/audio_session.cpp

@@ -579,7 +579,7 @@ static int phonemedia_stop(audio_session_t *session)
 		rtp_session_get_local_rtp_port(media->rtpsess, &ilocal_port);
 		rtp_session_destroy(media->rtpsess);
 		{
-			LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_AUDIO_RTP_DESTROY, CSimpleStringA::Format("audio rtp(media->rtpsess) destroy and local port is %u.", ilocal_port).GetData());
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("audio rtp(media->rtpsess) destroy and local port is %u.", ilocal_port);
 		}
 		media->rtpsess = NULL;
 	}

+ 5 - 4
Module/mod_sipphone/endpoint.cpp

@@ -184,7 +184,7 @@ static const char *state_desc[] = {
 static void endpoint_media_change_audio_dev(endpoint_call_t *call, e_dev_type current_dev_type)
 {
 	if (call->audio) {
-		LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_AUDIO_DEVICE_SWITCH, CSimpleStringA::Format("change audio device to %s mode.", DEV_PICKUP == current_dev_type ? "pickup" : "hand free").GetData());
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("change audio device to %s mode.", DEV_PICKUP == current_dev_type ? "pickup" : "hand free");
 		audio_session_change_dev(call->audio, current_dev_type);
 	}
 }
@@ -1080,12 +1080,13 @@ static void endpoint_callback(nua_event_t   event,
 
 	default:
 		if (status > 100) { /* unknown event -> print out error message */
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("unknown event %d: %03d %s.",
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("unknown event %d: %03d %s.",
 			event,
 			status,
 			phrase);
-		} else {
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("unknown event %d.", event);
+		} 
+		else {
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("unknown event %d.", event);
 		}
 		break;
 	}

+ 10 - 10
Module/mod_sipphone/mod_sipphone.cpp

@@ -605,7 +605,7 @@ void CSIPEntity::OnStarted()
 	}
 	
 	LogEvent(Severity_Middle, LOG_EVT_MOD_SIPPHONE_STARTED_SUCCESS, "sipphone entity started successfully.");
-	LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_ENTITY_STARTED, "sipphone entity started.");
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("sipphone entity started.");
 
 #ifdef RVC_OS_WIN
 	if (!m_pAudioMgr || !m_bAudioMgrInited){
@@ -1554,7 +1554,7 @@ ErrorCodeEnum CSIPEntity::GetLocalIP()
 					if (strstr(p, "198.168.") == NULL)
 					{
 						strcpy(m_localip, p);
-						LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_GET_LOCAL_IP, CSimpleStringA::Format("local ip == %s", m_localip).GetData());
+						DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("local ip == %s", m_localip);
 						return Error_Succeed;
 					}
 					else {
@@ -2097,10 +2097,10 @@ ErrorCodeEnum CSIPEntity::LoadConfig(endpoint_conf_t *conf)
 			rvc_snprintf(conf->audio_pickup_in_dev, MAX_PATH, "%s", strPickupIn.GetData());
 			rvc_snprintf(conf->audio_pickup_out_dev, MAX_PATH, "%s", strPickupOut.GetData());
 
-			LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_AUDIO_DSP_INFO, generateAudioDspFlags(conf->audio_dsp).GetData());
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s", generateAudioDspFlags(conf->audio_dsp).GetData());
 
 			AudioDspFlagsUseCentersetting(conf);
-			LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_CENTER_AUDIO_DSP_FLAGS, generateAudioDspFlags(conf->audio_dsp).GetData());
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s", generateAudioDspFlags(conf->audio_dsp).GetData());
 			
 			conf->ref_active_camera = &m_stVideoParam.iActiveCamera;
 			conf->ref_camera_switch = &m_stVideoParam.iCameraSwitch;
@@ -2422,7 +2422,7 @@ int CSIPEntity::StartCameraRender(int icamid, int ivideoview_x, int ivideoview_y
 	render_param.erender_queue = eSnapshot_Queue;
 
 	m_render->plocal_render = CreateVideoRenderObj(&t_callback);
-	LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_LOCAL_VIDEO_RENDER_CREATE, "local video render create.");
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("local video render create.");
 
 	memcpy(&m_render->render_param, &render_param, sizeof(rvc_video_render_params_t));
 
@@ -2509,10 +2509,10 @@ int CSIPEntity::StartBothCameraRender(SpReqAnsContext<PhoneService_StartBothCame
 	render_param.erender_queue = eSnapshot_Queue;
 
 	m_render->plocal_render = CreateVideoRenderObj(&t_callback);
-	LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_LOCAL_VIDEO_RENDER_CREATE, "local video render create.");
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("local video render create.");
 
 	m_render->premote_render = CreateVideoRenderObj(&t_callback);
-	LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_REMOTE_VIDEO_RENDER_CREATE, "remote video render create.");
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("remote video render create.");
 
 	memcpy(&m_render->render_param, &render_param, sizeof(rvc_video_render_params_t));
 
@@ -2567,7 +2567,7 @@ void CSIPPhoneSession::OnClose( ErrorCodeEnum eErrorCode )
 void CSIPPhoneSession::Handle_MakeCall( SpReqAnsContext<PhoneService_MakeCall_Req, PhoneService_MakeCall_Ans>::Pointer ctx )
 {
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_CALL_URL, CSimpleStringA::Format("make call [%s]", ctx->Req.to_uri.GetData()).GetData());
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("make call [%s]", ctx->Req.to_uri.GetData());
 
 	int rc = Error_Succeed;
 	MakeCallCommand_t *cmd = new MakeCallCommand_t();
@@ -3223,10 +3223,10 @@ int CSIPPhoneSession::start_video_render(rvc_video_render_params_t* render_param
 	t_callback.debug = &__video_render_log;
 
 	m_pEntity->m_render->plocal_render = CreateVideoRenderObj(&t_callback);
-	LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_LOCAL_VIDEO_RENDER_CREATE, "local video render create.");
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("local video render create.");
 
 	m_pEntity->m_render->premote_render = CreateVideoRenderObj(&t_callback);
-	LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_REMOTE_VIDEO_RENDER_CREATE, "remote video render create.");
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("remote video render create.");
 
 	memcpy(&m_pEntity->m_render->render_param, render_param, sizeof(rvc_video_render_params_t));
 	m_pEntity->m_render->local_render_threadid = 0;

+ 3 - 6
Module/mod_sipphone/unix/video_session.cpp

@@ -118,10 +118,10 @@ static void __dbg(void *user_data, const char *fmt, va_list arg)
 static void __logevent(void* user_data, int itype, const char* strmessage)
 {
 	if (0 == itype) {
-		LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_VIDEO_RTP_CREATE, strmessage);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("create %s", strmessage);
 	}
 	else {
-		LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_VIDEO_RTP_DESTROY, strmessage);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("destroy %s", strmessage);
 	}
 }
 
@@ -433,7 +433,7 @@ static int on_rx_frame(video_frame *frame, void *user_data)
 		used = 1;
 
 		if (false == session->bremoterender) {
-			LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_REMOTE_VIDEO_RENDER_STARTED, "start remote video render.");
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start remote video render.");
 			session->bremoterender = true;
 		}
 
@@ -1081,9 +1081,6 @@ static int start_video(video_session_t *session)
 			session->remote_player = pg_last_session->remote_player;
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("double record call remote_player reuse.");
 		}
-		else{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("pg_last_session is NULL, and call type is %d.", session->conf.nCallType);
-		}
 	}
 
 		BOOL bIsActiveInspect = FALSE;

+ 2 - 2
Module/mod_sipphone/win/video_session.cpp

@@ -77,10 +77,10 @@ static void __dbg(void *user_data, const char *fmt, va_list arg)
 static void __logevent(void* user_data, int itype, const char* strmessage)
 {
 	if (0 == itype) {
-		LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_VIDEO_RTP_CREATE, strmessage);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("create %s", strmessage);
 	}
 	else {
-		LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_VIDEO_RTP_DESTROY, strmessage);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("destroy %s", strmessage);
 	}
 }
 

+ 3 - 3
Other/libvideoqueue/libvideoqueue.cpp

@@ -147,7 +147,7 @@ public:
 	}
 
 	//往视频循环队列尾部插节点
-	bool InsertVideo(videoq_frame* Video, int flags,unsigned int nowtime)
+	bool InsertVideo(videoq_frame* Video, int flags, unsigned int nowtime)
 	{
 		if(m_ShareMem.IsValid())
 		{
@@ -679,9 +679,9 @@ Clibvideoqueue::~Clibvideoqueue()
 	return;
 }
 
-bool Clibvideoqueue::InsertVideo(videoq_frame* Video, int flags,unsigned int nowtime)
+bool Clibvideoqueue::InsertVideo(videoq_frame* Video, int flags, unsigned int nowtime)
 {
-	bool bRst = m_pImpl->InsertVideo(Video, flags,nowtime);
+	bool bRst = m_pImpl->InsertVideo(Video, flags, nowtime);
 	return bRst;
 }
 

+ 2 - 2
Other/libvideorecord/libvideorecord_impl.cpp

@@ -819,7 +819,7 @@ bool libvideorecord_impl::GetRecordVideoFrameSize()
 		}
 		else {
 			if (i > 0) {
-				m_pHostApi->Debug(RECORD_LOG_INFO, "get video framesize success, and failed times is %d.", i);
+				m_pHostApi->Debug(RECORD_LOG_DEBUG, "get video framesize success, and failed times is %d.", i);
 			}
 			bRet = true;
 			break;
@@ -853,7 +853,7 @@ bool libvideorecord_impl::GetRecordAudioFrameSize()
 		}
 		else {
 			if (i > 0) {
-				m_pHostApi->Debug(RECORD_LOG_INFO, "get audio framesize success, and failed times is %d.", i);
+				m_pHostApi->Debug(RECORD_LOG_DEBUG, "get audio framesize success, and failed times is %d.", i);
 			}
 			bRet = true;
 			break;

+ 0 - 6
Other/unix/libbizchan/bizchan.cpp

@@ -917,13 +917,10 @@ static void process(bizchan_t *chan)
 	}
 
 on_error:
-	//OutputDebugStringA("on_error");
-	bizlog(chan, "%s", "on_error");
 	if (!chan->connected) {
 		invoke_on_connect(chan, -1); // connect failed!
 	} else {
 		//....
-		//OutputDebugStringA("connected, and error!");
 		bizlog(chan, "%s", "connected, and error!");
 	}
 
@@ -1289,9 +1286,6 @@ static void process(bizchan_t* chan) {
 	}
 
 on_error:
-	//OutputDebugStringA("on_error");
-	bizlog(chan, "on_error");
-
 	if (!chan->connected) {
 		invoke_on_connect(chan, -1); // connect failed!
 	}

+ 0 - 1
Other/win/libbizchan/bizchan.c

@@ -856,7 +856,6 @@ static void process(bizchan_t *chan)
 	}
 
 on_error:
-	bizlog(chan, "%s", "on_error");
 	if (!chan->connected) {
 		invoke_on_connect(chan, -1); // connect failed!
 	} else {