Jelajahi Sumber

#IQRV #comment 实体日志优化

80274480 7 bulan lalu
induk
melakukan
5712a16cbb

+ 8 - 8
Module/mod_agentip/mod_agentip.cpp

@@ -24,7 +24,7 @@ public:
 class CAgentInterpreterEntity : public CEntityBase, public ILogListener, public ITimerListener
 {
 public:
-	CAgentInterpreterEntity() : m_iCurrentOp(ACM_CAMSWITCH_AUTO), m_bConnectAssist(FALSE), m_pCamSwitchChannel(NULL) {}
+	CAgentInterpreterEntity() : m_iCurrentOp(ACM_CAMSWITCH_AUTO), m_bConnectAssist(false), m_pCamSwitchChannel(NULL) {}
 	virtual ~CAgentInterpreterEntity() {}
 	virtual const char *GetEntityName() const { return "AgentInterpreter"; }
 
@@ -57,7 +57,7 @@ public:
 	{
 		m_pCamSwitchChannel = new CamSwitchChannelClient(this);
 		if (Error_Succeed == ConnectAssistChannel()) {
-			m_bConnectAssist = TRUE;
+			m_bConnectAssist = true;
 		}
 		else {
 			GetFunction()->SetTimer(1, this, 3150);
@@ -74,11 +74,11 @@ public:
 			if (m_pCamSwitchChannel != NULL){
 				m_pCamSwitchChannel->GetFunction()->CloseSession();
 				m_pCamSwitchChannel = NULL;
-				m_bConnectAssist = FALSE;
+				m_bConnectAssist = false;
 			}
 
 			if (Error_Succeed == ConnectAssistChannel()) {
-				m_bConnectAssist = TRUE;
+				m_bConnectAssist = true;
 			}
 			else {
 				GetFunction()->SetTimer(1, this, 3150);
@@ -183,13 +183,13 @@ private:
 	{
 		if (1 == dwTimerID)
 		{
-			if (FALSE == m_bConnectAssist) {
+			if (!m_bConnectAssist) {
 				if (Error_Succeed == ConnectAssistChannel()) {
-					m_bConnectAssist = TRUE;
+					m_bConnectAssist = true;
 				}
 			}
 
-			if (TRUE == m_bConnectAssist) {
+			if (m_bConnectAssist) {
 				GetFunction()->KillTimer(1);
 			}
 		}
@@ -199,7 +199,7 @@ private:
 	CamSwitchChannelClient *m_pCamSwitchChannel;
 	int m_iCurrentOp;
 	CAutoArray<CUUID> m_arrListener;
-	BOOL m_bConnectAssist;
+	bool m_bConnectAssist;
 };
 
 CamSwitchChannelClient::CamSwitchChannelClient( CAgentInterpreterEntity *pEntity ) : ChannelService_ClientBase(pEntity)

+ 1 - 1
Module/mod_assistantchannel/mod_assistantchannel.cpp

@@ -141,7 +141,7 @@ DeviceTypeEnum CBizChannelEntity::RvcGetDeviceType()
 	}
 
 	if (eType >= 0 && eType < sizeof(Device_Type_Table)/sizeof(char*)){
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
 	}
 		
 	return eType;

+ 1 - 1
Module/mod_counterconnector/mod_counterconnector.cpp

@@ -849,7 +849,7 @@ DeviceTypeEnum CCounterConnectorEntity::RvcGetDeviceType()
 	}
 
 	if (eType >= 0 && eType < sizeof(Device_Type_Table) / sizeof(char*)) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
 	}
 
 	return eType;

+ 8 - 8
Module/mod_countercontext/mod_countercontext.cpp

@@ -25,7 +25,7 @@ public:
 class CCounterContextEntity : public CEntityBase,public ILogListener, public ITimerListener
 {
 public:
-	CCounterContextEntity() : m_pChannelClient(NULL), m_bConnectAssist(FALSE) {}
+	CCounterContextEntity() : m_pChannelClient(NULL), m_bConnectAssist(false) {}
 	virtual ~CCounterContextEntity() {}
 	virtual const char *GetEntityName() const { return "CounterContext"; }
 
@@ -50,11 +50,11 @@ public:
 			if (m_pChannelClient != NULL){
 				m_pChannelClient->GetFunction()->CloseSession();
 				m_pChannelClient = NULL;
-				m_bConnectAssist = FALSE;
+				m_bConnectAssist = false;
 			}
 
 			if (Error_Succeed == ConnectAssistChannel()) {
-				m_bConnectAssist = TRUE;
+				m_bConnectAssist = true;
 			}
 			else {
 				GetFunction()->SetTimer(1, this, 3150);
@@ -79,7 +79,7 @@ public:
 	{
 		m_pChannelClient = new ChannelClient(this);
 		if (Error_Succeed == ConnectAssistChannel()) {
-			m_bConnectAssist = TRUE;
+			m_bConnectAssist = true;
 		}
 		else {
 			GetFunction()->SetTimer(1, this, 3150);
@@ -171,13 +171,13 @@ public:
 	void OnTimeout(DWORD dwTimerID)
 	{
 		if (1 == dwTimerID) {
-			if (FALSE == m_bConnectAssist) {
+			if (!m_bConnectAssist) {
 				if (Error_Succeed == ConnectAssistChannel()) {
-					m_bConnectAssist = TRUE;
+					m_bConnectAssist = true;
 				}
 			}
 
-			if (TRUE == m_bConnectAssist) {
+			if (m_bConnectAssist) {
 				GetFunction()->KillTimer(1);
 			}
 		}
@@ -185,7 +185,7 @@ public:
 private:
 	ChannelClient *m_pChannelClient;
 	CAutoArray<CUUID> m_arrListener;
-	BOOL m_bConnectAssist;
+	bool m_bConnectAssist;
 };
 
 ChannelClient::ChannelClient( CCounterContextEntity *pEntity ) : ChannelService_ClientBase(pEntity)

+ 1 - 1
Module/mod_evtconverter/mod_evtconverter.cpp

@@ -136,7 +136,7 @@ public:
 		}
 
 		if (eType >= 0 && eType < sizeof(Device_Type_Table)/sizeof(char*)){
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
 		}
 		return eType;
 	}

+ 1 - 1
Module/mod_interactioncontext/mod_interactioncontext.cpp

@@ -43,7 +43,7 @@ using namespace InteractionContext;
 class CInteractionContextEntity : public CEntityBase,public ILogListener, public ISysVarListener, public ITimerListener
 {
 public:
-	CInteractionContextEntity() : m_pChannelClient(NULL), m_bConnectAssist(FALSE){}
+	CInteractionContextEntity() : m_pChannelClient(NULL), m_bConnectAssist(false){}
 	virtual ~CInteractionContextEntity() {}
 	virtual const char *GetEntityName() const { return "InteractionContext"; }
 	virtual bool IsService()const{return true;}

+ 2 - 39
Module/mod_interactivecontrol/mod_interactivecontrol.cpp

@@ -185,7 +185,7 @@ DeviceTypeEnum CITCtrlEntity::RvcGetDeviceType()
 	}
 
 	if (eType >= 0 && eType < sizeof(Device_Type_Table) / sizeof(char*)) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
 	}
 
 	return eType;
@@ -220,9 +220,7 @@ ErrorCodeEnum CITCtrlEntity::__OnStart(ErrorCodeEnum preOperationError)
 	}
 
 	int i = 0;
-	m_arrListener.Init(8);
-	pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, 0x40100002, "IEBrowser");
-	pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, 0x40100003, "IEBrowser");
+	m_arrListener.Init(6);
 	pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_MOD_ASSISCHAN_STARTED_SUCCESS,NULL,false);
 	pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_MOD_LOCALPLAYER_STARTED_SUCCESS, NULL, false);
 	pFunc->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_MOD_SALESRECORDER_STARTED_SUCCESS, NULL, false);
@@ -999,21 +997,6 @@ void CITCtrlEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,co
 	const CAutoArray<DWORD> &Param, const char *pszEntityName, const char *pszModuleName,const char *pszMessage, const linkContext &pLinkInfo)
 {
 	switch (dwUserCode) {
-	case 0x40100002: // AgentInputState_Writing
-		{
-			AgentInputState evt;
-			evt.state = eAgentInputState_Writing;
-			SpSendBroadcast(GetFunction(), SP_MSG_OF(AgentInputState), SP_MSG_SIG_OF(AgentInputState), evt);
-		}
-		break;
-	case 0x40100003: // AgentInputState_Idle
-		{
-			AgentInputState evt;
-			evt.state = eAgentInputState_Idle;
-			SpSendBroadcast(GetFunction(), SP_MSG_OF(AgentInputState), SP_MSG_SIG_OF(AgentInputState), evt);
-		}
-		break;
-
 	case LOG_EVT_MOD_ASSISCHAN_STARTED_SUCCESS:
 		{
 			Sleep(310);
@@ -1479,11 +1462,6 @@ ErrorCodeEnum CITCtrlEntity::ConnectToLocalPlayer(bool blogevt)
 			}
 			return Error_InvalidState;
 		}
-		else {
-			if (blogevt) {
-				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Connect to LocalPlayClient Succeed!");
-			}
-		}
 	}
 
 	return Error_Succeed;
@@ -1541,11 +1519,6 @@ ErrorCodeEnum CITCtrlEntity::ConnectToSalesRecord(bool blogevt)
 			}
 			return Error_InvalidState;
 		}
-		else {
-			if (blogevt) {
-				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Connect to Sales Record Client Succeed!");
-			}
-		}
 	}
 
 	return Error_Succeed;
@@ -1592,11 +1565,6 @@ ErrorCodeEnum CITCtrlEntity::ConnectToSipPhone(bool blogevt)
 			}
 			return Error_InvalidState;
 		}
-		else {
-			if (blogevt) {
-				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Connect to Sipphone Client Succeed!");
-			}
-		}
 	}
 
 	return Error_Succeed;
@@ -1640,11 +1608,6 @@ ErrorCodeEnum CITCtrlEntity::ConnectMediaCtr(bool blogevt)
 			}
 			return Error_InvalidState;
 		}
-		else {
-			if (blogevt) {
-				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Connect to Mediacontroller Client Succeed!");
-			}
-		}
 	}
 
 	return Error_Succeed;

+ 1 - 1
Module/mod_livenessdetection/mod_livenessdetection.cpp

@@ -152,7 +152,7 @@ ErrorCodeEnum CLivenessDetectionEntity::__OnStart(ErrorCodeEnum preOperationErro
 	}
 
 	if (m_eDeviceType >= 0 && m_eDeviceType < sizeof(Device_Type_Table) / sizeof(char*)) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[m_eDeviceType]);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[m_eDeviceType]);
 	}
 
 	ErrorCodeEnum Error = Error_Succeed;

+ 1 - 1
Module/mod_mediacontroller/mod_mediacontroller.cpp

@@ -428,7 +428,7 @@ DeviceTypeEnum CMediaControllerEntity::RvcGetDeviceType()
 	}
 
 	if (eType >= 0 && eType < sizeof(Device_Type_Table) / sizeof(char*)) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
 	}
 
 	return eType;

+ 1 - 1
Module/mod_recorder/mod_recorder.cpp

@@ -771,7 +771,7 @@ DeviceTypeEnum CRecorderEntity::RvcGetDeviceType()
 	}
 
 	if (eType >= 0 && eType < sizeof(Device_Type_Table) / sizeof(char*)) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
 	}
 
 	m_terminalNo = stStaticinfo.strTerminalID;

+ 12 - 26
Module/mod_screenshot/mod_screenshot.cpp

@@ -128,11 +128,11 @@ public:
 			if (NULL != m_pChannelClient){
 				m_pChannelClient->GetFunction()->CloseSession();
 				m_pChannelClient = NULL;
-				m_bConnectAssist = FALSE;
+				m_bConnectAssist = false;
 			}
 
 			if (Error_Succeed == ConnectAssistChannel()) {
-				m_bConnectAssist = TRUE;
+				m_bConnectAssist = true;
 			}
 			else {
 				GetFunction()->SetTimer(1, this, 3370);
@@ -164,11 +164,11 @@ public:
 		spFunction->GetSystemStaticInfo(stStaticinfo);
 		if (stricmp(stStaticinfo.strMachineType,"RVC.WALL")==0)
 		{
-			m_bIsWallMachine = TRUE;
+			m_bIsWallMachine = true;
 		}
 		else
 		{
-			m_bIsWallMachine = FALSE;
+			m_bIsWallMachine = false;
 		}
 
 		return Error_Succeed;
@@ -178,7 +178,7 @@ public:
 	{
 		m_pChannelClient = new ChannelClient(this);
 		if (Error_Succeed == ConnectAssistChannel()) {
-			m_bConnectAssist = TRUE;
+			m_bConnectAssist = true;
 		}
 		else {
 			GetFunction()->SetTimer(1, this, 3370);
@@ -202,19 +202,6 @@ public:
 		return Error_Succeed;
 	}
 
-	void DumpCaptureDat(const char *buf, int n)
-	{
-		char tmp[MAX_PATH];
-		static int seq = 0;
-		sprintf(tmp, ".%scapture_%08d.dat", SPLIT_SLASH_STR, seq++);
-		FILE *fp = fopen(tmp, "wb");
-		if (fp) 
-		{
-			fwrite(buf,1,n, fp);
-			fclose(fp);
-		}
-	}
-
 	ErrorCodeEnum InitCapture()
 	{
 		if (m_enc_session) {
@@ -403,7 +390,6 @@ public:
 		Info.sub_type = ACM_SRN_ANS | ACM_SRN_SNAPSHOT;
 		Info.data.Alloc(size);
 		screencapture_encode(cx, cy, buf, Info.data.m_pData, &Info.data.m_iLength);
-		//DumpCaptureDat((const char*)Info.data.m_pData, Info.data.m_iLength);
 		(*m_pChannelClient)(EntityResource::getLink().upgradeLink())->Send(Info);
 		free(buf);
 		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("encode size = %d Bytes, time = %d", Info.data.m_iLength, GetTickCount());
@@ -510,13 +496,13 @@ private:
 	{
 		if (1 == dwTimerID)
 		{
-			if (FALSE == m_bConnectAssist) {
+			if (!m_bConnectAssist) {
 				if (Error_Succeed == ConnectAssistChannel()) {
-					m_bConnectAssist = TRUE;
+					m_bConnectAssist = true;
 				}
 			}
 
-			if (TRUE == m_bConnectAssist) {
+			if (m_bConnectAssist) {
 				GetFunction()->KillTimer(1);
 			}
 		}
@@ -526,13 +512,13 @@ private:
 	screen_encoder_session_t *m_enc_session;
 	ChannelClient *m_pChannelClient;
 	CAutoArray<CUUID> m_arrListener;
-	// add by ly 20150514
+
 	int m_id_seq;
-	BOOL m_bIsWallMachine;
-	BOOL m_bConnectAssist;
+	bool m_bIsWallMachine;
+	bool m_bConnectAssist;
 };
 
-// add by ly 20150514
+
 void CScreenShotSession::Handle_StartScreenShot(SpReqAnsContext<ScreenShotService_StartScreenShot_Req, ScreenShotService_StartScreenShot_Ans>::Pointer ctx)
 {
 	DbgToBeidou(ctx->link, __FUNCTION__)();

+ 1 - 1
Module/mod_sipphone/mod_sipphone.cpp

@@ -2276,7 +2276,7 @@ DeviceTypeEnum CSIPEntity::RvcGetDeviceType()
 	}
 
 	if (eType >= 0 && eType < sizeof(Device_Type_Table) / sizeof(char*)) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
 	}
 
 	return eType;

+ 1 - 1
Module/mod_snapshot/mod_snapshot.cpp

@@ -374,7 +374,7 @@ public:
 		}
 
 		if (eType >= 0 && eType < sizeof(Device_Type_Table) / sizeof(char*)) {
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
 		}
 
 		return eType;