瀏覽代碼

Z991239-3726 #comment 日志改造

80274480 3 年之前
父節點
當前提交
fa753c7a0d

+ 13 - 13
Module/mod_assistantchannel/mod_assistantchannel.cpp

@@ -80,28 +80,28 @@ static int MakeDesc(DWORD eScreen,DeviceTypeEnum eDevicetype)
 		{
 			if (stricmp(stStaticinfo.strSite,"CMB.FLB")==0)
 			{
-				LOG_TRACE("the type is mobile pad");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("the type is mobile pad");
 				m_eDeviceType = eMobilePadType;
 			}
 			else
 			{
-				LOG_TRACE("the type is pad");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("the type is pad");
 				m_eDeviceType = ePadtype;
 			}
 		}
 		else if (stricmp(stStaticinfo.strMachineType,"RVC.Desk2S")==0)
 		{
-			LOG_TRACE("the type is Desk2S");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("the type is Desk2S");
 			m_eDeviceType = eDesk2SType;
 		}
 		else if (stricmp(stStaticinfo.strMachineType,"RPM.Stand1S")==0)
 		{
-			LOG_TRACE("the type is RPM.Stand1S");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("the type is RPM.Stand1S");
 			m_eDeviceType = eRpm1sType;
 		}
 		else
 		{
-			LOG_TRACE("the type is standard");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("the type is standard");
 			m_eDeviceType = eStand2sType;
 		}
 		ListEntry_InitHead(&m_stateList);
@@ -122,7 +122,7 @@ static int MakeDesc(DWORD eScreen,DeviceTypeEnum eDevicetype)
 	CServerSessionBase * CBizChannelEntity::OnNewSession(const char* pszRemoteEntityName, const char * pszClass)
 	{
 		//LOG_FUNCTION();
-		//LOG_TRACE("%s connected class = %s!", pszRemoteEntityName, pszClass);
+		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s connected class = %s!", pszRemoteEntityName, pszClass);
 		return new ChannelServiceSession(this, m_id_seq++);
 	}
 
@@ -256,7 +256,7 @@ static int MakeDesc(DWORD eScreen,DeviceTypeEnum eDevicetype)
 	ErrorCodeEnum CBizChannelEntity::Send(int type, bool compress, bool encrypt, int sub_type, int id, CBlob &data)
 	{
 		if (m_eState == eChannelState_Connected) {
-			//LOG_TRACE("tx pkt, %d bytes, type = %d, compress = %d, encrypt = %d, sub_type = %d, id = %d, hash=%d", data.m_iLength, type, !!compress, !!encrypt, sub_type, id, hash32_buf(data.m_pData, data.m_iLength, 0));
+			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("tx pkt, %d bytes, type = %d, compress = %d, encrypt = %d, sub_type = %d, id = %d, hash=%d", data.m_iLength, type, !!compress, !!encrypt, sub_type, id, hash32_buf(data.m_pData, data.m_iLength, 0));
 			//Dbg("tx pkt, %d bytes, type = %d, compress = %d, encrypt = %d, sub_type = %d, id = %d, hash=%d", data.m_iLength, type, !!compress, !!encrypt, sub_type, id, hash32_buf(data.m_pData, data.m_iLength, 0));
 			int rc = bizchan_post_pkt(m_pChan, type, compress, encrypt, sub_type, id, (const char*)data.m_pData, data.m_iLength);
 			return rc == 0 ? Error_Succeed : Error_NetBroken;
@@ -270,7 +270,7 @@ static int MakeDesc(DWORD eScreen,DeviceTypeEnum eDevicetype)
 	void CBizChannelEntity::ChangeState(int new_state, const char *param)
 	{
 		if (m_eState != new_state) {
-			LOG_TRACE("change state from %s to %s", state2str(m_eState), state2str(new_state));
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("change state from %s to %s", state2str(m_eState), state2str(new_state));
 			m_eState = new_state;
 			state_entry *pos;
 			ListEntry_ForEach(pos, &m_stateList, state_entry, entry) {
@@ -288,7 +288,7 @@ static int MakeDesc(DWORD eScreen,DeviceTypeEnum eDevicetype)
 	//void on_recv_pkt(int type, int sub_type, const char *pkt, int pkt_size)
 	void CBizChannelEntity::on_recv_pkt(int type, int sub_type, int id, CBlob &data)
 	{
-		//LOG_TRACE("rx pkt, %d bytes, type = %d, sub_type = %d, id = %d, hash = %d", data.m_iLength, type, sub_type, id, hash32_buf(data.m_pData, data.m_iLength, 0));
+		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("rx pkt, %d bytes, type = %d, sub_type = %d, id = %d, hash = %d", data.m_iLength, type, sub_type, id, hash32_buf(data.m_pData, data.m_iLength, 0));
 		//Dbg("rx pkt, %d bytes, type = %d, sub_type = %d, id = %d, hash = %d", data.m_iLength, type, sub_type, id, hash32_buf(data.m_pData, data.m_iLength, 0));
 		rxpkt_entry *pos;
 		ListEntry_ForEach(pos, &m_rxpktList, rxpkt_entry, entry) 
@@ -389,7 +389,7 @@ static int MakeDesc(DWORD eScreen,DeviceTypeEnum eDevicetype)
 	}
 	void CBizChannelEntity::_on_recv_pkt(int type, int sub_type, int id, const char *pkt, int pkt_size)
 	{
-		//LOG_TRACE("_on rx pkt, %d bytes, type = %d, sub_type = %d, id = %d, hash = %d", pkt_size, type, sub_type, id, hash32_buf(pkt, pkt_size, 0));
+		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("_on rx pkt, %d bytes, type = %d, sub_type = %d, id = %d, hash = %d", pkt_size, type, sub_type, id, hash32_buf(pkt, pkt_size, 0));
 		NotifyOnRecvPkt *task = new NotifyOnRecvPkt();
 		task->m_pEntity = this;
 		task->type = type;
@@ -427,15 +427,15 @@ static int MakeDesc(DWORD eScreen,DeviceTypeEnum eDevicetype)
 
 void ChannelServiceSession::Handle_Connect( SpReqAnsContext<ChannelService_Connect_Req, ChannelService_Connect_Ans>::Pointer ctx )
 {
-	LOG_TRACE("start connect, %s:%d [%s]", (LPCSTR)ctx->Req.ip, ctx->Req.port, (LPCSTR)ctx->Req.callno);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start connect, %s:%d [%s]", (LPCSTR)ctx->Req.ip, ctx->Req.port, (LPCSTR)ctx->Req.callno);
 	ErrorCodeEnum Error = m_pEntity->Connect(ctx->Req.ip, ctx->Req.port, ctx->Req.callno, (CallingTypeEnum)ctx->Req.etype);
-	LOG_TRACE("connect Error = %d", Error);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("connect Error = %d", Error);
 	ctx->Answer(Error);
 }
 
 void ChannelServiceSession::Handle_Close( SpReqAnsContext<ChannelService_Close_Req, ChannelService_Close_Ans>::Pointer ctx )
 {
-	LOG_TRACE("connect close!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("connect close!");
 	ErrorCodeEnum Error = m_pEntity->Close();
 	ctx->Answer(Error);
 }

+ 10 - 14
Module/mod_localmediaplay/AdvertManage/MediaManage.cpp

@@ -168,10 +168,7 @@ size_t mediaManage::GetPlayListByLocal(rvcResourceParse_t* ResourceArr, size_t u
 bool mediaManage::InitResourseList(vector<string> resourceList)
 {
 	/*
-	��1��ԭresourseList�����ڣ���ʼ����Դ
-	��2��ԭresourseList���ڣ�ɾ��ʧЧ��Դ����������Դ
-	
-	��
+
 	*/
 	vector<string> needDelete(10), needAdd(10);
 	set<string> oldResourceList, newResourseList;
@@ -182,9 +179,9 @@ bool mediaManage::InitResourseList(vector<string> resourceList)
 		newResourseList.insert(*i);
 
 	auto deletePos = set_difference(oldResourceList.begin(), oldResourceList.end(), newResourseList.begin(), newResourseList.end(), needDelete.begin());//need to delete
-	needDelete.resize(deletePos - needDelete.begin());//����ȷ��needDelete��С 
+	needDelete.resize(deletePos - needDelete.begin());
 	auto addPos = set_difference(newResourseList.begin(), newResourseList.end(), oldResourceList.begin(), oldResourceList.end(), needAdd.begin());//need to add
-	needAdd.resize(addPos - needAdd.begin());//����ȷ��needAdd��С 
+	needAdd.resize(addPos - needAdd.begin());
 
 	DeleteResourceList(needDelete);
 	AddResourceList(needAdd);
@@ -210,12 +207,11 @@ bool mediaManage::AddResourceList(vector<string> resourceList)
 		wstring wfileName, wdirPath;
 		StringToWstring(wfileName, fileName);
 		StringToWstring(wdirPath, dirPath);
-		//(1)�ѽ�ѹ����2��ѹ���ļ������ڣ���3����ѹʧ��
 
 		if (!checkFileExist(dirPath))
 		{
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("dir %s not exist!", dirPath.c_str());
-			continue;//ѹ���ļ��в�����
+			continue;
 		}
 /*
 		if (!checkFileExist(dirPath) && createDir(dirPath) && !Unzip2Folder((BSTR)wfileName.c_str(), (BSTR)wdirPath.c_str()))
@@ -228,21 +224,21 @@ bool mediaManage::AddResourceList(vector<string> resourceList)
 		if (!findVaildConfig(dirPath, configPath))
 		{
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("can not find config file in %s//%s", dirPath.c_str(), configPath.c_str());
-			continue;//�����������
+			continue;
 		}
 
 		vector<ResourceParse> mediaList;
 		if (!parseResourceIni(configPath.c_str(), mediaList))
 		{
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("parse config %s fail!", configPath.c_str());
-			continue;//�����ļ���ȡʧ��
+			continue;
 		}
 
 		string resourcePath = dirPath + SPLIT_SLASH_STR;
 /*		if (!getUniqueDir(dirPath, resourcePath))
 		{
 			Dbg("error:find multi resource dir!");
-			continue;//δ�ҵ�Ψһ�ù��Ŀ¼
+			continue;
 		}
 		resourcePath = dirPath + "\\" + resourcePath + "\\";
 		*/
@@ -318,7 +314,7 @@ void mediaManage::InitResourceListByLocal()
 	
 	std::stable_sort(m_localList.begin(), m_localList.end(), [](const ResourceParse& a, const ResourceParse& b) {
 		return a.priority > b.priority;
-		});//��priority����
+		});
 
 
 	for (auto i = m_localList.begin(); i != m_localList.end(); i++)
@@ -347,7 +343,7 @@ void mediaManage::DeleteResourceList(vector<string> resourceList)
 		{
 			if (*i == j->m_resourceName)
 			{
-				m_curParse.erase(j);//������ʧЧ
+				m_curParse.erase(j);
 				break;
 			}
 		}
@@ -408,7 +404,7 @@ void mediaManage::clearOutdataResource()
 		}
 
 		auto deletePos = set_difference(oldResourceList.begin(), oldResourceList.end(), newResourseList.begin(), newResourseList.end(), needDelete.begin());//need to delete
-		needDelete.resize(deletePos - needDelete.begin());//����ȷ��needDelete��С 
+		needDelete.resize(deletePos - needDelete.begin());
 
 
 		for (vector<string>::iterator i = needDelete.begin(); i != needDelete.end(); i++)