فهرست منبع

Z991239-3726 #comment 日志改造

80274480 3 سال پیش
والد
کامیت
5d3bfd7c30

+ 73 - 73
Module/mod_SalesRecorder/mod_SalesRecorder.cpp

@@ -95,14 +95,14 @@ static BOOL CheckDiskStatus(const char *szRoot, int nPercent, int *pFreeRatio)
 	BOOL ret = GetDiskFreeSpaceEx(szRoot, &lpFreeBytesAvailableToCaller, &lpTotalNumberOfBytes, &lpTotalNumberOfFreeBytes);
 	if (ret == 0)
 	{
-		Dbg("CheckDiskStatus.GetDiskFreeSpaceEx failed(%d).",GetLastError());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("CheckDiskStatus.GetDiskFreeSpaceEx failed(%d).",GetLastError());
 		return FALSE;
 	}
 	DWORD dwTotal = lpTotalNumberOfBytes.QuadPart/1048576;
 	DWORD dwTotalFree = lpTotalNumberOfFreeBytes.QuadPart/1048576;
 	int ratio = dwTotalFree*100/dwTotal;
 	*pFreeRatio = ratio;
-	Dbg("free disk %d MB, %d percent free.\n", dwTotalFree, ratio);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("free disk %d MB, %d percent free.\n", dwTotalFree, ratio);
 	//if (ratio < (100-MAX_DISK_PERCENT))
 	if (ratio < (100-nPercent))
 	{
@@ -289,7 +289,7 @@ void SalesRecordServiceSession::Handle_GetOFLVideoRecords( SpReqAnsContext<Sales
 	CSimpleStringA CardNo = CSimpleStringW2A(ctx->Req.CardNo);
 	CSimpleStringA BeginTime = CSimpleStringW2A(ctx->Req.BeginTime);
 	CSimpleStringA EndTime = CSimpleStringW2A(ctx->Req.EndTime);
-	Dbg("Handle_GetOFLVideoRecords:BeginTime=%s,EndTime=%s",(LPCTSTR)BeginTime,(LPCTSTR)EndTime);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Handle_GetOFLVideoRecords:BeginTime=%s,EndTime=%s",(LPCTSTR)BeginTime,(LPCTSTR)EndTime);
 	ctx->Answer(Error_Succeed);
 }
 
@@ -304,14 +304,14 @@ void SalesRecordServiceSession::Handle_CheckVideoDiskStatus( SpReqAnsContext<Sal
 
 void SalesRecordServiceSession::Handle_PlayVideo(SpReqAnsContext<SalesRecorderSerVice_PlayVideo_Req, SalesRecorderSerVice_PlayVideo_Ans>::Pointer ctx)
 {
-	Dbg("PlayVideo name is %s.", (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("PlayVideo name is %s.", (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
 	ErrorCodeEnum ErrorCode = m_pEntity->HandleDisplayVideo();
 	ctx->Answer(ErrorCode);
 }
 
 void SalesRecordServiceSession::Handle_SaveVideo(SpReqAnsContext<SalesRecorderSerVice_SaveVideo_Req, SalesRecorderSerVice_SaveVideo_Ans>::Pointer ctx)
 {
-	Dbg("Save Video name is %s.", (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Save Video name is %s.", (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
 	ErrorCodeEnum ErrorCode = m_pEntity->HandleSaveVideo();
 	ctx->Answer(ErrorCode);
 }
@@ -325,21 +325,21 @@ void SalesRecordServiceSession::Handle_StopRecord(SpReqAnsContext<SalesRecorderS
 
 void SalesRecordServiceSession::Handle_SetAudioTransFlag(SpReqAnsContext<SalesRecorderSerVice_SetAudioTransFlag_Req, SalesRecorderSerVice_SetAudioTransFlag_Ans>::Pointer ctx)
 {
-	Dbg("Audio transmission flag is %s.", ctx->Req.TransFlag ? "true" : "false");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Audio transmission flag is %s.", ctx->Req.TransFlag ? "true" : "false");
 	ctx->Answer(Error_Succeed);
 }
 
 
 void SalesRecordServiceSession::Handle_StopShowVideo(SpReqAnsContext<SalesRecorderSerVice_StopShowVideo_Req, SalesRecorderSerVice_StopShowVideo_Ans>::Pointer ctx)
 {
-	Dbg("Stop Show Video name is %s.", (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop Show Video name is %s.", (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
 	ErrorCodeEnum ErrorCode = m_pEntity->HandleStopShowVideo();
 	ctx->Answer(ErrorCode);
 }
 
 void SalesRecordServiceSession::Handle_PlaySalesRecord(SpReqAnsContext<SalesRecorderSerVice_PlaySalesRecord_Req, SalesRecorderSerVice_PlaySalesRecord_Ans>::Pointer ctx)
 {
-	Dbg("Stop Show Video name is %s.", (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop Show Video name is %s.", (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
 	ErrorCodeEnum ErrorCode = m_pEntity->HandlePlaySalesRecordVideo(ctx->Req.WndX, ctx->Req.WndY, ctx->Req.WndWidth, ctx->Req.WndHeight);
 	ctx->Answer(ErrorCode);
 }
@@ -353,7 +353,7 @@ void SalesRecordServiceSession::Handle_StartRemoteRecord(SpReqAnsContext<SalesRe
 CServerSessionBase * CSalesRecorderEntity::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 SalesRecordServiceSession(this);
 }
 
@@ -377,7 +377,7 @@ ErrorCodeEnum CSalesRecorderEntity::__OnStart( ErrorCodeEnum preOperationError )
 
 #ifdef RVC_OS_WIN
 	if (SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS)){
-		Dbg("Set Process(%d) RealTime Priority Success.",GetCurrentProcessId());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Set Process(%d) RealTime Priority Success.",GetCurrentProcessId());
 	}
 #endif
 
@@ -420,7 +420,7 @@ ErrorCodeEnum CSalesRecorderEntity::__OnStart( ErrorCodeEnum preOperationError )
 	{
 		m_bApplyHighQuality = FALSE;
 	}
-	Dbg("[dbg] m_bApplyHighQuality:%d",m_bApplyHighQuality);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("[dbg] m_bApplyHighQuality:%d",m_bApplyHighQuality);
 
 	m_bEwsRecord = FALSE;
 
@@ -570,7 +570,7 @@ void CSalesRecorderEntity::OnSelfTest(EntityTestEnum eTestType,CSmartPointer<ITr
 	if (Test_ShakeHand == eTestType)
 	{
 		if (m_bNeedRestart){
-			Dbg("[OnSelfTest] entity need restart now.");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("[OnSelfTest] entity need restart now.");
 			pTransactionContext->SendAnswer(Error_Unexpect);
 		}
 		else{
@@ -588,13 +588,13 @@ int CSalesRecorderEntity::GetActiveCamera()
 
 int CSalesRecorderEntity::GetCameraState()
 {
-	Dbg("get active camera = %d", m_iCameraState);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get active camera = %d", m_iCameraState);
 	return m_iCameraState;
 }
 
 void CSalesRecorderEntity::OnRecordFailed(eRvcRecordFailedCase eCase, const char* pszMessage, bool bRecordDevFault )
 {
-	Dbg("OnSalesRecordFailed!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("OnSalesRecordFailed!");
 
 	if (eCase < eDefault && eCase >= 0) {
 		LogEvent(Severity_Middle, LOG_EVT_UI_RECORDFAILED, record_failed_case_table[eCase]);
@@ -671,7 +671,7 @@ void CSalesRecorderEntity::OnSysVarEvent( const char *pszKey, const char *pszVal
 {
 	if (_stricmp(pszKey, SYSVAR_CAMERASTATE) == 0)
 	{
-		Dbg("camera state from : %c to %c", pszOldValue[0], pszValue[0]);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("camera state from : %c to %c", pszOldValue[0], pszValue[0]);
 		m_iCameraState = pszValue[0]; 
 		if (pszValue[0] == 'E')
 		{
@@ -698,7 +698,7 @@ void CSalesRecorderEntity::OnSysVarEvent( const char *pszKey, const char *pszVal
 	}
 	else if (_stricmp(pszKey, SYSVAR_CALLTYPE) == 0)
 	{
-		Dbg("sys calltype from: %c to %c", pszOldValue[0], pszValue[0]);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("sys calltype from: %c to %c", pszOldValue[0], pszValue[0]);
 		if(pszValue[0] == CALLTYPE_NORMAL)
 		{
 			m_nSysCallType = 0;
@@ -721,33 +721,33 @@ void CSalesRecorderEntity::OnLog( const CAutoArray<CUUID> &SubIDs, const CUUID n
 	{
 	case LOG_EVT_UI_STARTRECORD: 
 	case LOG_EVT_UI_STARTAFTERPREVIEWRECORD:
-		Dbg("start record, pszMessage = %s.",pszMessage);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start record, pszMessage = %s.",pszMessage);
 		HandleStartRecord(pszMessage, false);
 		break;
 
 	case LOG_EVT_UI_STOPREMOTERECORD: 
-		Dbg("stop remote record, pszMessage = %s.",pszMessage);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop remote record, pszMessage = %s.",pszMessage);
 		StopRecord();
 		LogWarn(Severity_Low, Error_Debug, LOG_EVT_STOP_REMOTERECORD, "stop remote record.");
 		break;
 
 	case LOG_EVT_UI_STOPRECORD:
-		Dbg("stop record, pszMessage = %s.",pszMessage);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop record, pszMessage = %s.",pszMessage);
 		HandleStopRecord(pszMessage);
 		break;
 
 	case LOG_EVT_UI_SHOWVIDEO:
-		Dbg("show video record, pszMessage = %s.",pszMessage);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("show video record, pszMessage = %s.",pszMessage);
 		HandleDisplayVideo();
 		break;
 
 	case LOG_EVT_UI_SAVEVIDEO:
-		Dbg("save record!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("save record!");
 		HandleSaveVideo();
 		break;
 
 	case LOG_EVT_UI_DELETEVIDEO:
-		Dbg("delete record!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("delete record!");
 		HandleDeleteVideo();
 		break;
 
@@ -755,21 +755,21 @@ void CSalesRecorderEntity::OnLog( const CAutoArray<CUUID> &SubIDs, const CUUID n
 		break;
 
 	case EVENT_UKEY_PULLOUT:
-		Dbg("ukey pull out!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ukey pull out!");
 		break;
 
 	case LOG_EVT_UI_VIDEOAPPENDWATERMARK:
-		Dbg("handle video append water mark param is %s.", pszMessage);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("handle video append water mark param is %s.", pszMessage);
 		HandleVideoAppendWatermark(pszMessage);
 		break;
 
 	case LOG_EVT_SALESRECORD_ENTITY_EXCEPTION:
-		Dbg("handle sales record entity exception, and message is %s.", pszMessage);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("handle sales record entity exception, and message is %s.", pszMessage);
 		HandleSalesRecordEntityException(pszMessage);
 		break;
 
 	case LOG_EVT_AUDIOSTREAM_TRANSMISSION_FAILED:
-		Dbg("handle audio stream transmission failed.");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("handle audio stream transmission failed.");
 		break;
 
 	default:
@@ -838,21 +838,21 @@ void CSalesRecorderEntity::StartOnSiteSalesRecord(const int fps, const char* wmv
 		tAudioParams.bIsNsOn = false;
 	}
 
-	Dbg("init lib wmv record success! and record type is %s and output audio quality is %s, audio noise suppression flag is %s. noise suppression policy is %d.", record_type_table[eRecordType], audio_quality_type_table[m_eAudioOutQuality], tAudioParams.bIsNsOn ? "true" : "false", tAudioParams.iNsPolicy);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("init lib wmv record success! and record type is %s and output audio quality is %s, audio noise suppression flag is %s. noise suppression policy is %d.", record_type_table[eRecordType], audio_quality_type_table[m_eAudioOutQuality], tAudioParams.bIsNsOn ? "true" : "false", tAudioParams.iNsPolicy);
 	if (m_pRecorder->StartWmvRecord(fps, videoquality, &tAudioParams, subtitleParam, bWholeSection, FALSE, (LPCSTR)m_TempDir,
 		m_TempDir.GetLength(), wmvfilename, strlen(wmvfilename)))
 	{
 		m_bStarted = TRUE;
-		Dbg("Start WmvRecord success!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Start WmvRecord success!");
 	}
 	else {
-		Dbg("Start WmvRecord failed!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Start WmvRecord failed!");
 	}
 }
 
 void CSalesRecorderEntity::StartRecord(const char *wmvfilename, int videoquality, int audioOutBitRate, SubtitleParam *subtitleParam /* = NULL */, BOOL bWholeSection /* = FALSE */, BOOL bSessionManage /* = FALSE */, eRvcRecordType eRecordType /* = eSingleSide */)
 {
-	Dbg("wmvfilename = %s", wmvfilename);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("wmvfilename = %s", wmvfilename);
 
 	StartOnSiteSalesRecord(10, wmvfilename, videoquality, audioOutBitRate, subtitleParam, bWholeSection, bSessionManage, eRecordType);
 }
@@ -887,16 +887,16 @@ ErrorCodeEnum CSalesRecorderEntity::ShowVideo( const char *wmvfilename )
 			CSimpleStringA strFindFileName = CSimpleStringA::Format("%s*.%s", wmvfilename, RVC_RECORD_SUFFIX);
 			ULONGLONG uVideoCount = 0;
 			BOOL bRet = FindMatchedFile((LPCSTR)strPath, (LPCTSTR)strFindFileName, uVideoCount);
-			Dbg("bRet = %d while find %s", bRet, wmvfilename);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("bRet = %d while find %s", bRet, wmvfilename);
 			if(bRet){
-				Dbg("succeed to get record count while play video!");
-				//Dbg("m_pPlayer = %p while play!", m_pPlayer);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to get record count while play video!");
+				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_pPlayer = %p while play!", m_pPlayer);
 				//m_pPlayer->PlayVideo((LPCSTR)strPath, wmvfilename, uVideoCount);
-				Dbg("succeed to play video!");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to play video!");
 			}
 			else{
 				ErrorCode = Error_NotExist;
-				Dbg("play video failed for %s no exist!", wmvfilename);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("play video failed for %s no exist!", wmvfilename);
 			}
 		}
 	}
@@ -921,16 +921,16 @@ ErrorCodeEnum CSalesRecorderEntity::PlaySalesRecordVideo( const char *wmvfilenam
 			CSimpleStringA strFindFileName = CSimpleStringA::Format("%s*.%s", wmvfilename, RVC_RECORD_SUFFIX);
 			ULONGLONG uVideoCount = 0;
 			BOOL bRet = FindMatchedFile((LPCSTR)strPath, (LPCTSTR)strFindFileName, uVideoCount);
-			Dbg("bRet = %d while find %s", bRet, wmvfilename);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("bRet = %d while find %s", bRet, wmvfilename);
 			if(bRet){
-				Dbg("succeed to get record count while play sales record video!");
-				//Dbg("m_pPlayer = %p while play!", m_pPlayer);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to get record count while play sales record video!");
+				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_pPlayer = %p while play!", m_pPlayer);
 				//m_pPlayer->PlaySalesRecordVideo(iWndX, iWndY, iWndWidth, iWndHeight,(LPCSTR)strPath, wmvfilename, uVideoCount);
-				Dbg("succeed to play sales record video!");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to play sales record video!");
 			}
 			else{
 				ErrorCode = Error_NotExist;
-				Dbg("play play sales record video failed for %s no exist!", wmvfilename);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("play play sales record video failed for %s no exist!", wmvfilename);
 			}
 		}
 	}
@@ -956,7 +956,7 @@ void CSalesRecorderEntity::DeleteVideo( const char *wmvfilename )
 			BOOL bRet = FindMatchedFile((LPCSTR)strPath, (LPCTSTR)strFindFileName, uVideoCount);
 			if(bRet)
 			{
-				Dbg("succeed to get record count while delete video!");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to get record count while delete video!");
 				CSimpleStringA fileName;
 				BOOL bDeleteSucc = TRUE;
 				for(int i = 0; i != uVideoCount; ++i)
@@ -965,16 +965,16 @@ void CSalesRecorderEntity::DeleteVideo( const char *wmvfilename )
 
 					if(remove(fileName.GetData())) {
 						bDeleteSucc = FALSE;
-						Dbg("Error Code %lu while delete %s ", errno, fileName.GetData());
+						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Error Code %lu while delete %s ", errno, fileName.GetData());
 					}
 				}
 				if (bDeleteSucc) {
-					Dbg("succeed to delete videos!");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to delete videos!");
 				}
 			}
 			else
 			{
-				Dbg("[DeleteVideo] videos not exist or have been deleted!");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("[DeleteVideo] videos not exist or have been deleted!");
 			}
 		}
 	}
@@ -1016,7 +1016,7 @@ ErrorCodeEnum CSalesRecorderEntity::SaveVideo( const char *wmvfilename )
 			if(bRet)
 			{
 				strFindFileName = strFindFileName.SubString(0,strFindFileName.GetLength()-5);
-				Dbg("succeed to get sales record count while save video!");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to get sales record count while save video!");
 				CSimpleStringA destPath;
 				Error = GetFunction()->GetPath("UploadVideo", destPath);
 				if(Error == Error_Succeed)
@@ -1026,7 +1026,7 @@ ErrorCodeEnum CSalesRecorderEntity::SaveVideo( const char *wmvfilename )
 					}
 					CSimpleStringA sourFileName, destFileName;
 					BOOL bMoveSucc = TRUE;
-					Dbg("strFindFileName=%s", (LPCSTR)strFindFileName);
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("strFindFileName=%s", (LPCSTR)strFindFileName);
 					for(int i = 0; i != uVideoCount; ++i)
 					{
 						sourFileName = CSimpleStringA::Format("%s%s_%d.%s", (LPCSTR)sourPath, (LPCSTR)strFindFileName, i, RVC_RECORD_SUFFIX);
@@ -1077,7 +1077,7 @@ CSimpleStringA CSalesRecorderEntity::GetTerminalStage()
 	CSmartPointer<IEntityFunction> Func = GetFunction();
 	CSimpleStringA strValue = "";
 	Func->GetSysVar("TerminalStage", strValue);
-	Dbg("TerminalStage:%s", (LPCTSTR)strValue);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("TerminalStage:%s", (LPCTSTR)strValue);
 	return strValue;
 }
 
@@ -1110,13 +1110,13 @@ ErrorCodeEnum CSalesRecorderEntity::StopRecordVideo()
 	}
 	else
 	{
-		Dbg("UIClient connected success!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("UIClient connected success!");
 		InteractiveControl::UIService_StopRecordVideo_Req req;
 		InteractiveControl::UIService_StopRecordVideo_Ans ans;
 		rc = pUIClient->StopRecordVideo(req, ans, 5000);
 		if(rc != Error_Succeed)
 		{
-			Dbg("Stop record video failed return 0x%08x", rc);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop record video failed return 0x%08x", rc);
 		}
 
 		pUIClient->GetFunction()->CloseSession();
@@ -1165,7 +1165,7 @@ ErrorCodeEnum CSalesRecorderEntity::HandleStartRecord(const char *pszMessage, co
 			strcpy_s(subTitle.CustCardNo, 24, strCardNo.GetData());
 		}
 		else {
-			Dbg("Invalid CustCardNo.");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Invalid CustCardNo.");
 		}
 	}
 
@@ -1260,7 +1260,7 @@ ErrorCodeEnum CSalesRecorderEntity::HandleStartRecord(const char *pszMessage, co
 
 		if(256 == m_audio_out_bitrate){
 			i_audio_out_bitrate = 128;
-			Dbg("change remote record audio out bitrate to %d.", i_audio_out_bitrate);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("change remote record audio out bitrate to %d.", i_audio_out_bitrate);
 		}
 	} 
 
@@ -1287,7 +1287,7 @@ ErrorCodeEnum CSalesRecorderEntity::HandleDisplayVideo()
 {
 	// 视频播放 libwmpplayer
 	m_bIsShowVideo = TRUE;
-	Dbg("play record file name is %s!", m_SalesVideoName);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("play record file name is %s!", m_SalesVideoName);
 	ErrorCodeEnum ErrorCode = ShowVideo(m_SalesVideoName);
 	return ErrorCode;
 }
@@ -1297,9 +1297,9 @@ ErrorCodeEnum CSalesRecorderEntity::HandlePlaySalesRecordVideo(int iWndX, int iW
 {
 	// 视频播放 libwmpplayer
 	m_bIsShowVideo = TRUE;
-	Dbg("play sales record video file name is %s!", m_SalesVideoName);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("play sales record video file name is %s!", m_SalesVideoName);
 	ErrorCodeEnum ErrorCode = PlaySalesRecordVideo(m_SalesVideoName, iWndX, iWndY, iWndWidth, iWndHeight);
-	Dbg("play sales record video return code is 0x%08x.", ErrorCode);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("play sales record video return code is 0x%08x.", ErrorCode);
 	return ErrorCode;
 }
 
@@ -1307,14 +1307,14 @@ ErrorCodeEnum CSalesRecorderEntity::HandlePlaySalesRecordVideo(int iWndX, int iW
 ErrorCodeEnum CSalesRecorderEntity::HandleStopShowVideo()
 {
 	// 视频播放 libwmpplayer
-	Dbg("stop show video record file name is %s!", m_SalesVideoName);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop show video record file name is %s!", m_SalesVideoName);
 	ErrorCodeEnum ErrorCode = Error_Succeed;
 	if(m_bIsShowVideo)
 	{
-		//Dbg("m_pPlayer = %p while play!", m_pPlayer);
+		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_pPlayer = %p while play!", m_pPlayer);
 		//m_pPlayer->Close();
 		m_bIsShowVideo = FALSE;
-		Dbg("succeed to stop show video!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to stop show video!");
 	}
 	else{
 		ErrorCode = Error_NotImpl;
@@ -1381,7 +1381,7 @@ ErrorCodeEnum CSalesRecorderEntity::HandleSalesRecordEntityException(const char*
 	SalesRecordException evt;
 	evt.failedmsg = CSimpleStringA2W(pszMessage==NULL?"现场销售双录过程出现异常!":pszMessage);
 	SpSendBroadcast(GetFunction(), SP_MSG_OF(SalesRecordException), SP_MSG_SIG_OF(SalesRecordException), evt);
-	Dbg("[dbg] SalesRecord entity exception broadcast sent!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("[dbg] SalesRecord entity exception broadcast sent!");
 
 	//停止录像
 	StopRecord();
@@ -1429,11 +1429,11 @@ ErrorCodeEnum CSalesRecorderEntity::RealSelfCheck()
 	{
 		pSelfcheckClient->SafeDelete();
 		pSelfcheckClient = NULL;
-		Dbg("SelfcheckClient connect fail!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SelfcheckClient connect fail!");
 	}
 	else
 	{
-		Dbg("SelfcheckClient connect success!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SelfcheckClient connect success!");
 	}
 
 	if (pSelfcheckClient)
@@ -1445,11 +1445,11 @@ ErrorCodeEnum CSalesRecorderEntity::RealSelfCheck()
 		Error = pSelfcheckClient->RealCheck(req,ans,Timeout);
 		if (Error!=Error_Succeed)
 		{
-			Dbg("RealSelfcheck fail!");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("RealSelfcheck fail!");
 		}
 		else
 		{
-			Dbg("RealSelfcheck success!");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("RealSelfcheck success!");
 		}
 		pSelfcheckClient->GetFunction()->CloseSession();
 	}
@@ -1467,7 +1467,7 @@ bool IsMatchedVideo(WIN32_FIND_DATA fileData)
 	if ('S' == fileData.cFileName[0] || 'W' == fileData.cFileName[0]){
 		SYSTEMTIME sysTime;
 		FileTimeToSystemTime(&fileData.ftCreationTime, &sysTime);
-		Dbg("File %s create data info is %d %d %d.", fileData.cFileName, sysTime.wYear, sysTime.wMonth, sysTime.wDay);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("File %s create data info is %d %d %d.", fileData.cFileName, sysTime.wYear, sysTime.wMonth, sysTime.wDay);
 		if ((2020 == sysTime.wYear) && (sysTime.wMonth == 1)){
 			if (sysTime.wDay >= 3 && sysTime.wDay <= 10){
 				bRet = true;
@@ -1516,13 +1516,13 @@ void CSalesRecorderEntity::UploadTempPathVideos()
 					CSimpleStringA sourFileName = CSimpleStringA::Format("%s%s", (LPCSTR)sourPath, FindFileData.cFileName);
 					CSimpleStringA destFileName = CSimpleStringA::Format("%sBAK_%s", (LPCSTR)destPath, FindFileData.cFileName);
 					if(!MoveFile((LPCSTR)sourFileName, (LPCSTR)destFileName)) {
-						Dbg("Error Code %lu while move %s ", GetLastError(), (LPCSTR)sourFileName);
+						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Error Code %lu while move %s ", GetLastError(), (LPCSTR)sourFileName);
 					}else{
-						Dbg("Move File %s success.", (LPCSTR)sourFileName);
+						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Move File %s success.", (LPCSTR)sourFileName);
 					}
 				}
 				else{
-					Dbg("File (%s) is not matched.", FindFileData.cFileName);
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("File (%s) is not matched.", FindFileData.cFileName);
 				}
 
 				if (!FindNextFile(hFind, &FindFileData))
@@ -1575,7 +1575,7 @@ bool IsMatchedVideo(LPCTSTR path, struct dirent* file)
 		if (stat(ttp, &fileInfo) == 0) {
 			SYSTEMTIME sysTime;
 			sysTime = Time_tToSystemTime(fileInfo.st_mtime);
-			Dbg("File %s create data info is %d %d %d.", file->d_name, sysTime.wYear, sysTime.wMonth, sysTime.wDay);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("File %s create data info is %d %d %d.", file->d_name, sysTime.wYear, sysTime.wMonth, sysTime.wDay);
 			if ((2020 == sysTime.wYear) && (sysTime.wMonth == 1)) {
 				if (sysTime.wDay >= 3 && sysTime.wDay <= 10) {
 					bRet = true;
@@ -1622,14 +1622,14 @@ void CSalesRecorderEntity::UploadTempPathVideos() {
 					CSimpleStringA sourFileName = CSimpleStringA::Format("%s%s", (LPCSTR)sourPath, pFile->d_name);
 					CSimpleStringA destFileName = CSimpleStringA::Format("%sBAK_%s", (LPCSTR)destPath, pFile->d_name);
 					if (rename(sourFileName.GetData(), destFileName.GetData())) {
-						Dbg("Error Code %lu while move %s.", errno, sourFileName.GetData());
+						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Error Code %lu while move %s.", errno, sourFileName.GetData());
 					}
 					else {
-						Dbg("Move File %s success.", sourFileName.GetData());
+						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Move File %s success.", sourFileName.GetData());
 					}
 				}
 				else {
-					Dbg("File (%s) is not matched.", pFile->d_name);
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("File (%s) is not matched.", pFile->d_name);
 				}
 			}
 		}
@@ -1643,7 +1643,7 @@ void CSalesRecorderEntity::UploadTempPathVideos() {
 ErrorCodeEnum CSalesRecorderEntity::SetRecordAudioQuality(int iAudioQuality)
 {
 	ErrorCodeEnum eRet = Error_Succeed;
-	Dbg("iAudioQuality == %d.", iAudioQuality);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("iAudioQuality == %d.", iAudioQuality);
 
 	switch (iAudioQuality)
 	{
@@ -1671,7 +1671,7 @@ ErrorCodeEnum CSalesRecorderEntity::SetRecordAudioQuality(int iAudioQuality)
 ErrorCodeEnum CSalesRecorderEntity::SetRecordAudioNsPolicy(int iNsPolicy)
 {
 	ErrorCodeEnum eRet = Error_Succeed;
-	Dbg("iNsPolicy == %d.", iNsPolicy);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("iNsPolicy == %d.", iNsPolicy);
 
 	if (1 == iNsPolicy || 3 == iNsPolicy){
 		m_iAudioNsPolicy = iNsPolicy;
@@ -1704,7 +1704,7 @@ DeviceTypeEnum CSalesRecorderEntity::RvcGetDeviceType()
 		eType = eDesk2SType;
 		WORD nMajor = stStaticinfo.MachineVersion.GetMajor();
 		WORD nMinor = stStaticinfo.MachineVersion.GetMinor();
-		Dbg("MachineVersion is %d.%d", nMajor, nMinor);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("MachineVersion is %d.%d", nMajor, nMinor);
 		if (2 == nMajor) {
 			eType = eDesk2SIntegratedType;
 		}

+ 125 - 125
Module/mod_interactivecontrol/mod_interactivecontrol.cpp

@@ -43,7 +43,7 @@ struct CRecvValue
 
 void CITCtrlEntity::OnAudioPlayRet(const char *pszEntityName, DWORD dwMessageId, DWORD dwMessageSignature, LocalMediaPlay::AudioPlayRet &evt)
 {
-	Dbg("AudioPlayRet %s", (LPCTSTR)evt.AudioNames);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("AudioPlayRet %s", (LPCTSTR)evt.AudioNames);
 	AudioEndRet ret;
 	ret.ret = evt.ret;
 	ret.AudioNames = evt.AudioNames;
@@ -61,7 +61,7 @@ void CITCtrlEntity::OnPreStart(CAutoArray<CSimpleStringA> strArgs,CSmartPointer<
 { 
 	auto Error = GetFunction()->SubscribeBroadcast("LocalMediaPlay", NULL, this, m_uidLocalMediaListenser);
 	if (Error != Error_Succeed) {
-		LOG_TRACE("subscribe LocalMediaPlay evt failed!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("subscribe LocalMediaPlay evt failed!");
 	}
 
 	Error = __OnStart(Error_Succeed);
@@ -122,22 +122,22 @@ void CITCtrlEntity::OnStarted()
 	m_pPlayClient = new LocalPlayClient(this);
 	Error = m_pPlayClient->Connect();
 	if (Error != Error_Succeed){
-		Dbg("Fail to connect to LocalPlayClient, with error = %d!", Error);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Fail to connect to LocalPlayClient, with error = %d!", Error);
 		m_pPlayClient->SafeDelete();
 		m_pPlayClient = NULL;
 		return;
 	}
-	Dbg("Succeed to connect to LocalPlayClient!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to connect to LocalPlayClient!");
 
 	m_pSalesRecordClient = new SalesRecordClient(this);
 	Error = m_pSalesRecordClient->Connect();
 	if (Error != Error_Succeed) {
-		Dbg("Fail to connect to SalesRecordClient, with error = %d!", Error);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Fail to connect to SalesRecordClient, with error = %d!", Error);
 		m_pSalesRecordClient->SafeDelete();
 		m_pSalesRecordClient = NULL;
 		return;
 	}
-	Dbg("Succeed to connect to SalesRecordClient!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to connect to SalesRecordClient!");
 }
 
 
@@ -179,7 +179,7 @@ DeviceTypeEnum CITCtrlEntity::RvcGetDeviceType()
 		eType = eDesk2SType;
 		WORD nMajor = stStaticinfo.MachineVersion.GetMajor();
 		WORD nMinor = stStaticinfo.MachineVersion.GetMinor();
-		Dbg("MachineVersion is %d.%d", nMajor, nMinor);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("MachineVersion is %d.%d", nMajor, nMinor);
 		if (2 == nMajor) {
 			eType = eDesk2SIntegratedType;
 		}
@@ -195,7 +195,7 @@ DeviceTypeEnum CITCtrlEntity::RvcGetDeviceType()
 	}
 
 	if (eType >= 0 && eType < sizeof(Device_Type_Table) / sizeof(char*)) {
-		Dbg("device type is %s.", Device_Type_Table[eType]);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("device type is %s.", Device_Type_Table[eType]);
 	}
 
 	return eType;
@@ -210,12 +210,12 @@ ErrorCodeEnum CITCtrlEntity::__OnStart(ErrorCodeEnum preOperationError)
 
 	auto Error = pFunc->RegistSysVarEvent("CustomerHandle", this);
 	if (Error != Error_Succeed){
-		LOG_TRACE("register sysvar %s failed!", "CustomerHandle");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("register sysvar %s failed!", "CustomerHandle");
 	}
 
 	Error = pFunc->RegistSysVarEvent("SessionID", this);
 	if (Error != Error_Succeed){
-		LOG_TRACE("register sysvar %s failed!", "SessionID");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("register sysvar %s failed!", "SessionID");
 	}
 	m_nSysCallType = 0;
 	{
@@ -260,7 +260,7 @@ ErrorCodeEnum CITCtrlEntity::__OnStart(ErrorCodeEnum preOperationError)
 				m_bAdvOnFlag = true;
 			}
 		}
-		Dbg("AdvOnFlag:[%s]", m_bAdvOnFlag ? "true" : "false");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("AdvOnFlag:[%s]", m_bAdvOnFlag ? "true" : "false");
 	}
 
 	if (!(eMobilePadType==m_eDeviceType|| IsSurpportContinuRecordType()))
@@ -322,14 +322,14 @@ void CITCtrlEntity::AdverPlayManage(const char* pszValue, const char* pszOldValu
 {
 	if (pszValue && pszOldValue)
 	{
-		Dbg("Current Customer State is %c, Old Customer State is %c", pszValue[0], pszOldValue[0]);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Current Customer State is %c, Old Customer State is %c", pszValue[0], pszOldValue[0]);
 		if ('N' == pszValue[0]){
-			Dbg("%s StartPlayVideo", __FUNCTION__);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s StartPlayVideo", __FUNCTION__);
 			StartPlayVideo(1, 0, 0, 0, 0, 800);
 		}
 		else {
 			if ('N' == pszOldValue[0]){
-				Dbg("%s StopPlayVideo", __FUNCTION__);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s StopPlayVideo", __FUNCTION__);
 				StopPlayVideo(1, 800);
 			}
 		}
@@ -359,7 +359,7 @@ void CITCtrlEntity::BcastCustomerState(const char *pszValue,const char *pszOldVa
 	} 
 	else {
 		ok = 0;
-		LOG_TRACE("bug! OnSysVarEvent unknown %s", pszValue);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("bug! OnSysVarEvent unknown %s", pszValue);
 	}
 	GetFunction()->GetSysVar("SessionID",m_SessionID);
 	evt.session_id = CSimpleStringA2W(m_SessionID);
@@ -372,7 +372,7 @@ void CITCtrlEntity::BcastSessionid(const char *sessionid,const char *pszEntityNa
 {
 	CSimpleStringA pszValue;
 	GetFunction()->GetSysVar("CustomerHandle", pszValue);
-	Dbg("CustomerHandle = %c",pszValue[0]);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("CustomerHandle = %c",pszValue[0]);
 	CustomerState evt;
 	int ok = 1;
 	if (pszValue[0] == 'N') { // None
@@ -394,7 +394,7 @@ void CITCtrlEntity::BcastSessionid(const char *sessionid,const char *pszEntityNa
 	else 
 	{
 		ok = 0;
-		LOG_TRACE("bug! OnSysVarEvent unknown %s", pszValue);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("bug! OnSysVarEvent unknown %s", pszValue);
 	}
 	GetFunction()->GetSysVar("SessionID",m_SessionID);
 	evt.session_id = CSimpleStringA2W(m_SessionID);
@@ -406,7 +406,7 @@ void CITCtrlEntity::BcastSessionid(const char *sessionid,const char *pszEntityNa
 
 void CITCtrlEntity::OnSysVarEvent(const char *pszKey, const char *pszValue,const char *pszOldValue,const char *pszEntityName)
 {
-	LOG_TRACE("entity:%s key:%s value:%s", pszEntityName, pszKey, pszValue);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("entity:%s key:%s value:%s", pszEntityName, pszKey, pszValue);
 	if (_stricmp(pszKey,"CustomerHandle") == 0)
 	{
 		if (pszValue)
@@ -417,14 +417,14 @@ void CITCtrlEntity::OnSysVarEvent(const char *pszKey, const char *pszValue,const
 			}
 #endif
 			BcastCustomerState(pszValue, pszOldValue, pszEntityName);
-			Dbg("CustomerState change to %c",pszValue[0]);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("CustomerState change to %c",pszValue[0]);
 		}
 	}
 	else if (_stricmp(pszKey, "UIState") == 0) {
 #ifdef RVC_OS_LINUX
 		if (_strnicmp(pszValue, "M", strlen("M")) == 0)
 		{
-			Dbg("return Main path");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("return Main path");
 			LogEvent(Severity_Middle, LOG_EVT_UI_RETURNMENU, NULL);
 		}
 #endif
@@ -433,10 +433,10 @@ void CITCtrlEntity::OnSysVarEvent(const char *pszKey, const char *pszValue,const
 	{
 		CSimpleStringA strSessionID;
 		GetFunction()->GetSysVar("SessionID",strSessionID);
-		Dbg("Sessionid change to %s",strSessionID.GetData());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Sessionid change to %s",strSessionID.GetData());
 		BcastSessionid(strSessionID,pszEntityName);
 	}
-	else if (_stricmp(pszKey,"CameraState") == 0) // add by ly 20160708(edit by ly 2018/03/08)
+	else if (_stricmp(pszKey,"CameraState") == 0)
 	{
 		if (pszValue)
 		{
@@ -449,7 +449,7 @@ void CITCtrlEntity::OnSysVarEvent(const char *pszKey, const char *pszValue,const
 					evt.state = pszValue[0];
 					evt.camname = CSimpleStringA2W(strlen(pszValue)<=1?"":pszValue+1); // add camera name by ly at 20161018
 					SpSendBroadcast(GetFunction(), SP_MSG_OF(CameraFaultOccurred), SP_MSG_SIG_OF(CameraFaultOccurred), evt);
-					Dbg("[dbg] CameraFaultOccurred broadcast sent!");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("[dbg] CameraFaultOccurred broadcast sent!");
 				}
 
 				CSmartPointer<IEntityFunction> Func = GetFunction();
@@ -478,21 +478,21 @@ void CITCtrlEntity::OnSysVarEvent(const char *pszKey, const char *pszValue,const
 					evt.state = pszValue[0];
 					evt.camname = CSimpleStringA2W(strlen(pszValue)<=1?"":pszValue+1); // add camera name by ly at 20161018
 					SpSendBroadcast(GetFunction(), SP_MSG_OF(CameraFaultOccurred), SP_MSG_SIG_OF(CameraFaultOccurred), evt);
-					Dbg("[dbg] CameraFaultOccurred broadcast sent!");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("[dbg] CameraFaultOccurred broadcast sent!");
 				}
 
 				WideAngleCameraFault evt;
 				evt.state = pszValue[0];
 				evt.camname = CSimpleStringA2W(strlen(pszValue)<=1?"":pszValue+1); // add camera name by ly at 20161213
 				SpSendBroadcast(GetFunction(), SP_MSG_OF(WideAngleCameraFault), SP_MSG_SIG_OF(WideAngleCameraFault), evt);
-				Dbg("[dbg] WideAngleCameraFault broadcast sent!");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("[dbg] WideAngleCameraFault broadcast sent!");
 				LogEvent(Severity_Middle,LOG_EVT_UI_STOP_CONTINURECORD,"Fault");
 			}
 		}
 	}
 	else if (_stricmp(pszKey, SYSVAR_CALLTYPE) == 0) 
 	{
-		Dbg("sys call type from: %c to %c", pszOldValue[0], pszValue[0]);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("sys call type from: %c to %c", pszOldValue[0], pszValue[0]);
 		if(pszValue[0] == CALLTYPE_NORMAL)
 		{
 			m_nSysCallType = 0;
@@ -522,7 +522,7 @@ void CITCtrlEntity::SyncMenuTree(int tree, int path)
 				buf.OpenWrite(32 + m_strMenuTree.GetLength() * 2);
                 CSimpleString16Bit menuTree = CSimpleStringW216Bit(m_strMenuTree);
                 buf& menuTree;
-                Dbg("%s After convert: %s", __FUNCTION__, CSimpleString16Bit2A(menuTree).GetData());
+                DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s After convert: %s", __FUNCTION__, CSimpleString16Bit2A(menuTree).GetData());
 				ChannelService_Send_Info Info;
 				Info.sub_type = ACM_IM_MENUTREE;
 				Info.type = ACM_TYPE_IM;
@@ -533,13 +533,13 @@ void CITCtrlEntity::SyncMenuTree(int tree, int path)
 			}
 			else
 			{
-				Dbg("cur call type cannot send pkt");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("cur call type cannot send pkt");
 			}
 
 		} 
 		else 
 		{
-			Dbg("warning: slv has not set menu tree!!!");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("warning: slv has not set menu tree!!!");
 		}
 	}
 		
@@ -552,7 +552,7 @@ void CITCtrlEntity::SyncMenuTree(int tree, int path)
 				buf.OpenWrite(32 + m_strMenuPath.GetLength()*2);
                 CSimpleString16Bit menuPath = CSimpleStringW216Bit(m_strMenuPath);
                 buf& menuPath;
-                Dbg("%s After convert: %s", __FUNCTION__, CSimpleString16Bit2A(menuPath).GetData());
+                DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s After convert: %s", __FUNCTION__, CSimpleString16Bit2A(menuPath).GetData());
 				ChannelService_Send_Info Info;
 				Info.sub_type = ACM_IM_MENUPATH;
 				Info.type = ACM_TYPE_IM;
@@ -563,12 +563,12 @@ void CITCtrlEntity::SyncMenuTree(int tree, int path)
 			}
 			else
 			{
-				Dbg("cur call type cannot send pkt");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("cur call type cannot send pkt");
 			}
 		}
 		else 
 		{
-			Dbg("warning: slv has not set menu path!!!");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("warning: slv has not set menu path!!!");
 		}
 	}
 }
@@ -581,7 +581,7 @@ ErrorCodeEnum CITCtrlEntity::SendAgentText(CSimpleStringW strText)
 		buf.OpenWrite(32 + strText.GetLength()*2);
         CSimpleString16Bit convertData = CSimpleStringW216Bit(strText);
         buf& convertData;
-        Dbg("%s After convert: %s", __FUNCTION__, CSimpleString16Bit2A(convertData).GetData());
+        DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s After convert: %s", __FUNCTION__, CSimpleString16Bit2A(convertData).GetData());
 		ChannelService_Send_Info Info;
 		Info.sub_type = ACM_IM_SHOWTEXT;
 		Info.type = ACM_TYPE_IM;
@@ -592,7 +592,7 @@ ErrorCodeEnum CITCtrlEntity::SendAgentText(CSimpleStringW strText)
 	}
 	else
 	{
-		Dbg("cur call type cannot send pkt");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("cur call type cannot send pkt");
 		return Error_Succeed;
 	}
 }
@@ -609,7 +609,7 @@ void CITCtrlEntity::SetMenuTreePath(CSimpleStringW strMenuPath)
 	CSimpleStringA string = CSimpleStringW2A(m_strMenuPath);
 	if (string == "Main")
 	{
-		Dbg("return Main path");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("return Main path");
 		LogEvent(Severity_Middle,LOG_EVT_UI_RETURNMENU,NULL);
 	}
 }
@@ -626,7 +626,7 @@ ErrorCodeEnum CITCtrlEntity::SendFrontSyncData(int id, CSimpleStringW strContent
         buf& id;
         CSimpleString16Bit convertedData = CSimpleStringW216Bit(strContent);
         buf& convertedData;
-        Dbg("%s After convert: %s", __FUNCTION__, CSimpleString16Bit2A(convertedData).GetData());
+        DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s After convert: %s", __FUNCTION__, CSimpleString16Bit2A(convertedData).GetData());
 #endif //RVC_OS_WIN
 		ChannelService_Send_Info Info;
 		Info.sub_type = ACM_IM_FRONTSYNC;
@@ -638,7 +638,7 @@ ErrorCodeEnum CITCtrlEntity::SendFrontSyncData(int id, CSimpleStringW strContent
 	}
 	else
 	{
-		Dbg("cur call type cannot send pkt");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("cur call type cannot send pkt");
 		return Error_Succeed;
 	}
 }
@@ -654,7 +654,7 @@ ErrorCodeEnum CITCtrlEntity::SendH5SyncData(CSimpleStringW strContent)
 #else
         CSimpleString16Bit convertedData = CSimpleStringW216Bit(strContent);
         buf& convertedData;
-        Dbg("%s After convert: %s", __FUNCTION__, CSimpleString16Bit2A(convertedData).GetData());
+        DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s After convert: %s", __FUNCTION__, CSimpleString16Bit2A(convertedData).GetData());
 #endif //RVC_OS_WIN
 			
 		ChannelService_Send_Info Info;
@@ -667,7 +667,7 @@ ErrorCodeEnum CITCtrlEntity::SendH5SyncData(CSimpleStringW strContent)
 	}
 	else
 	{
-		Dbg("cur call type cannot send pkt");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("cur call type cannot send pkt");
 		return Error_Succeed;
 	}
 }
@@ -708,7 +708,7 @@ void CITCtrlEntity::OnReceivePacket(int type,int sub_type, const char *data, int
 			buf & content16;
 			CSimpleStringA reqContextA = CSimpleString16Bit2A(content16);
 			CSimpleStringW reqContextW = CSimpleStringA2W(reqContextA);
-			Dbg("RecvAgentText is %s.", reqContextA.GetData());
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("RecvAgentText is %s.", reqContextA.GetData());
 			evt.content = reqContextW;
 #endif // RVC_OS_WIN
 			SpSendBroadcast(GetFunction(), SP_MSG_OF(RecvAgentText), SP_MSG_SIG_OF(RecvAgentText), evt);
@@ -735,7 +735,7 @@ void CITCtrlEntity::OnReceivePacket(int type,int sub_type, const char *data, int
 			evt.Serialize(buf);
 			SpSendBroadcast(GetFunction(), SP_MSG_OF(EnterSubMenu), SP_MSG_SIG_OF(EnterSubMenu), evt);
 			SendAnswer(ACM_IM_ANS | sub_type, Error_Succeed);
-			Dbg("send broadcast EnterSubMenu!");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("send broadcast EnterSubMenu!");
 		}
 		else if (sub_type == ACM_IM_MENUGOPARENT) 
 		{
@@ -745,7 +745,7 @@ void CITCtrlEntity::OnReceivePacket(int type,int sub_type, const char *data, int
 			evt.Serialize(buf);
 			SpSendBroadcast(GetFunction(), SP_MSG_OF(EnterParentMenu), SP_MSG_SIG_OF(EnterParentMenu), evt);
 			SendAnswer(ACM_IM_ANS | sub_type, Error_Succeed);
-			Dbg("send broadcast EnterParentMenu!");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("send broadcast EnterParentMenu!");
 		} 
 		else if (sub_type == ACM_IM_BACKSYNC) 
 		{
@@ -780,7 +780,7 @@ void CITCtrlEntity::OnReceivePacket(int type,int sub_type, const char *data, int
 			//evt.Serialize(buf);
 			RecvP2pFlwReq evt;
 			evt.content = (wchar_t*)data;
-			Dbg("lens = %d",evt.content.GetLength());
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("lens = %d",evt.content.GetLength());
 			SpSendBroadcast(GetFunction(), SP_MSG_OF(RecvP2pFlwReq), SP_MSG_SIG_OF(RecvP2pFlwReq), evt);			
 		}
 		else 
@@ -799,7 +799,7 @@ void CITCtrlEntity::OnReceivePacket(int type,int sub_type, const char *data, int
 			buf.OpenRead(data,size);
 			RecValue.Serialize(buf);
 			evt.value = RecValue.nValue;
-			Dbg("Broadcast webmsg sub_type=%d,value=%d",evt.type,evt.value);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Broadcast webmsg sub_type=%d,value=%d",evt.type,evt.value);
 			SpSendBroadcast(GetFunction(), SP_MSG_OF(CommonWebMsg), SP_MSG_SIG_OF(CommonWebMsg), evt); 
 		}
 		else 
@@ -827,7 +827,7 @@ void CITCtrlEntity::SendAnswer(int sub_type, ErrorCodeEnum Error)
 	}
 	else
 	{
-		Dbg("cur call type cannot send pkt");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("cur call type cannot send pkt");
 	}
 }
 
@@ -837,7 +837,7 @@ void CITCtrlEntity::SendAnswertoMobile(CSimpleStringW packet)
 	buf.OpenWrite();
     CSimpleString16Bit convertedData = CSimpleStringW216Bit(packet);
     buf& convertedData;
-    Dbg("%s After convert: %s", __FUNCTION__, CSimpleString16Bit2A(convertedData).GetData());
+    DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s After convert: %s", __FUNCTION__, CSimpleString16Bit2A(convertedData).GetData());
 	ChannelService_Send_Info Info;
 	Info.sub_type = ACM_SUBTYPE_ANS_FLOW;
 	Info.compress = true;
@@ -1019,11 +1019,11 @@ ErrorCodeEnum CITCtrlEntity::SetLocalAudioVolume(int nVolume, DWORD dwTimeout)
 
 ErrorCodeEnum CITCtrlEntity::SendBusinessDesktopCmd(CSimpleStringA xapName, CSimpleStringA command)
 {
-	Dbg("in entity SendBusinessDesktopCmd");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("in entity SendBusinessDesktopCmd");
 	EnterBFlowFromUT evt;
 	evt.xapName = CSimpleStringA2W(xapName);
 	evt.command = CSimpleStringA2W(command);
-	Dbg("xapName = %s, command = %s", evt.xapName, evt.command);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("xapName = %s, command = %s", evt.xapName, evt.command);
 	SpSendBroadcast(GetFunction(), SP_MSG_OF(EnterBFlowFromUT), SP_MSG_SIG_OF(EnterBFlowFromUT), evt);
 	return Error_Succeed;
 }
@@ -1041,18 +1041,18 @@ ErrorCodeEnum CITCtrlEntity::GetHandfreeCallOutVolume(int& nVolume, DWORD dwTime
 	}
 	else
 	{
-		Dbg("pSipPhoneClient connected success!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("pSipPhoneClient connected success!");
 		PhoneService_GetHandfreeOutVolume_Req req;
 		PhoneService_GetHandfreeOutVolume_Ans ans;
 		rc = pSipPhoneClient->GetHandfreeOutVolume(req, ans, 1000);
 		nVolume = ans.Volume;
 		if(Error_Succeed == rc)
 		{
-			Dbg("get hand free out volume success.");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get hand free out volume success.");
 		}
 		else
 		{
-			Dbg("get hand free out volume failed for 0x%08x", rc);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get hand free out volume failed for 0x%08x", rc);
 		}
 
 		pSipPhoneClient->GetFunction()->CloseSession();
@@ -1076,18 +1076,18 @@ ErrorCodeEnum CITCtrlEntity::SetHandfreeCallOutVolume(int nVolume, DWORD dwTimeo
 	}
 	else
 	{
-		Dbg("pSipPhoneClient connected success!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("pSipPhoneClient connected success!");
 		PhoneService_SetHandfreeOutVolume_Req req;
 		req.Volume = nVolume;
 		PhoneService_SetHandfreeOutVolume_Ans ans;
 		rc = pSipPhoneClient->SetHandfreeOutVolume(req, ans, 1000);
 		if(Error_Succeed == rc)
 		{
-			Dbg("set hand free out volume success.");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("set hand free out volume success.");
 		}
 		else
 		{
-			Dbg("set hand free out volume failed for 0x%08x", rc);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("set hand free out volume failed for 0x%08x", rc);
 		}
 
 		pSipPhoneClient->GetFunction()->CloseSession();
@@ -1111,18 +1111,18 @@ ErrorCodeEnum CITCtrlEntity::GetPickupCallOutVolume(int& nVolume, DWORD dwTimeou
 	}
 	else
 	{
-		Dbg("pSipPhoneClient connected success!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("pSipPhoneClient connected success!");
 		PhoneService_GetPickupOutVolume_Req req;
 		PhoneService_GetPickupOutVolume_Ans ans;
 		rc = pSipPhoneClient->GetPickupOutVolume(req, ans, 1000);
 		nVolume = ans.Volume;
 		if(Error_Succeed == rc)
 		{
-			Dbg("get pickup out volume success.");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get pickup out volume success.");
 		}
 		else
 		{
-			Dbg("get pickup out volume failed for 0x%08x", rc);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get pickup out volume failed for 0x%08x", rc);
 		}
 
 		pSipPhoneClient->GetFunction()->CloseSession();
@@ -1145,18 +1145,18 @@ ErrorCodeEnum CITCtrlEntity::SetPickupCallOutVolume(int nVolume, DWORD dwTimeout
 	}
 	else
 	{
-		Dbg("pSipPhoneClient connected success!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("pSipPhoneClient connected success!");
 		PhoneService_SetPickupOutVolume_Req req;
 		req.Volume = nVolume;
 		PhoneService_SetPickupOutVolume_Ans ans;
 		rc = pSipPhoneClient->SetPickupOutVolume(req, ans, 1000);
 		if(Error_Succeed == rc)
 		{
-			Dbg("set pickup out volume success.");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("set pickup out volume success.");
 		}
 		else
 		{
-			Dbg("set pickup out volume failed for 0x%08x", rc);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("set pickup out volume failed for 0x%08x", rc);
 		}
 
 		pSipPhoneClient->GetFunction()->CloseSession();
@@ -1169,7 +1169,7 @@ ErrorCodeEnum CITCtrlEntity::SetPickupCallOutVolume(int nVolume, DWORD dwTimeout
 		const DWORD dwSysError,const DWORD dwUserCode,const DWORD dwEntityInstanceID, const WORD wEntityDevelID, 
 		const CAutoArray<DWORD> &Param, const char *pszEntityName, const char *pszModuleName,const char *pszMessage, const linkContext& pLinkInfo)
 	{
-		Dbg("user_code = %08x", dwUserCode);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("user_code = %08x", dwUserCode);
 		switch (dwUserCode) {
 		case 0x40100002: // AgentInputState_Writing
 			{
@@ -1188,24 +1188,24 @@ ErrorCodeEnum CITCtrlEntity::SetPickupCallOutVolume(int nVolume, DWORD dwTimeout
 
 	case LOG_EVT_SELFCHECK_ASSISTANTCHANNEL_IDLE:
 		{
-			Dbg("recv LOG_EVT_SELFCHECK_ASSISTANTCHANNEL_IDLE");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_SELFCHECK_ASSISTANTCHANNEL_IDLE");
 			if (m_pChannelClient!=NULL)
 			{
 				m_pChannelClient->GetFunction()->CloseSession();
 				m_pChannelClient = NULL;
-				Dbg("Close AssistChannel Session ");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Close AssistChannel Session ");
 			}
 
 			if (m_pChannelClient == NULL)
 			{
-				Dbg("ReConnection AssistChannel Session");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ReConnection AssistChannel Session");
 				m_pChannelClient = new ChannelClient(this);
 				ErrorCodeEnum Error = m_pChannelClient->Connect();
 				if (Error != Error_Succeed) 
 				{
 					m_pChannelClient->SafeDelete();
 					m_pChannelClient = NULL;
-					Dbg("m_pChannelClient connect fail!");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_pChannelClient connect fail!");
 				}
 
 				if (Error == Error_Succeed)
@@ -1242,30 +1242,30 @@ ErrorCodeEnum CITCtrlEntity::SetPickupCallOutVolume(int nVolume, DWORD dwTimeout
 		break;
 	case LOG_EVT_SELFCHECK_LOCALMEDIAPLAY_IDLE:
 		{
-			Dbg("recv LOG_EVT_SELFCHECK_LOCALMEDIAPLAY_IDLE");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_SELFCHECK_LOCALMEDIAPLAY_IDLE");
 			if (m_pPlayClient!=NULL)
 			{
 				m_pPlayClient->GetFunction()->CloseSession();
 				m_pPlayClient = NULL;
-				Dbg("Close AssistChannel Session ");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Close AssistChannel Session ");
 			}
 
 			if (m_pPlayClient == NULL)
 			{
-				Dbg("ReConnection LocalPlay Session");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ReConnection LocalPlay Session");
 				m_pPlayClient = new LocalPlayClient(this);
 				ErrorCodeEnum Error = m_pPlayClient->Connect();
 				if (Error != Error_Succeed) 
 				{
 					m_pPlayClient->SafeDelete();
-					Dbg("m_pPlayClient connect fail!");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_pPlayClient connect fail!");
 				}
 			}
 		}
 		break;
 	case LOG_EVT_CONTINURECORD_FAILED:
 		{
-			Dbg("recv LOG_EVT_CONTINURECORD_FAILED");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_CONTINURECORD_FAILED");
 		}
 		break;
 	default:
@@ -1297,16 +1297,16 @@ ErrorCodeEnum CITCtrlEntity::PlayVideo(CSimpleStringA strVideoName)
 	}
 	else
 	{
-		Dbg("SalesClient connected success!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SalesClient connected success!");
 		SalesRecorderSerVice_PlayVideo_Req req;
 		SalesRecorderSerVice_PlayVideo_Ans ans;
 		req.VideoName = CSimpleStringA2W(strVideoName);
 		rc = m_pSalesRecordClient->PlayVideo(req, ans, 5000);
 		if(Error_Succeed == rc){
-			Dbg("Play video %s success.", strVideoName.GetData());
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Play video %s success.", strVideoName.GetData());
 		}
 		else{
-			Dbg("Play video %s failed for 0x%08x",strVideoName.GetData(), rc);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Play video %s failed for 0x%08x",strVideoName.GetData(), rc);
 		}
 	}
 
@@ -1324,7 +1324,7 @@ ErrorCodeEnum CITCtrlEntity::StartPlaySalesRecordVideo(CSimpleStringA strVideoNa
 	}
 	else
 	{
-		Dbg("SalesClient connected success!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SalesClient connected success!");
 		SalesRecorderSerVice_PlaySalesRecord_Req req;
 		SalesRecorderSerVice_PlaySalesRecord_Ans ans;
 		req.VideoName = CSimpleStringA2W(strVideoName);
@@ -1335,11 +1335,11 @@ ErrorCodeEnum CITCtrlEntity::StartPlaySalesRecordVideo(CSimpleStringA strVideoNa
 		rc = m_pSalesRecordClient->PlaySalesRecord(req, ans, 5000);
 		if(Error_Succeed == rc)
 		{
-			Dbg("Play Sales Record %s success.", strVideoName.GetData());
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Play Sales Record %s success.", strVideoName.GetData());
 		}
 		else
 		{
-			Dbg("Play Sales Record %s failed for 0x%08x",strVideoName.GetData(), rc);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Play Sales Record %s failed for 0x%08x",strVideoName.GetData(), rc);
 		}
 	}
 
@@ -1355,18 +1355,18 @@ ErrorCodeEnum CITCtrlEntity::StopShowVideo(CSimpleStringA strVideoName)
 		rc = Error_DevConnFailed;
 	}
 	else{
-		Dbg("SalesClient connected success!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SalesClient connected success!");
 		SalesRecorderSerVice_StopShowVideo_Req req;
 		SalesRecorderSerVice_StopShowVideo_Ans ans;
 		req.VideoName = CSimpleStringA2W(strVideoName);
 		rc = m_pSalesRecordClient->StopShowVideo(req, ans, 5000);
 		if(Error_Succeed == rc)
 		{
-			Dbg("Stop Show video %s success.", strVideoName.GetData());
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop Show video %s success.", strVideoName.GetData());
 		}
 		else
 		{
-			Dbg("Stop Show video %s failed for 0x%08x",strVideoName.GetData(), rc);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop Show video %s failed for 0x%08x",strVideoName.GetData(), rc);
 		}
 	}
 
@@ -1383,18 +1383,18 @@ ErrorCodeEnum CITCtrlEntity::SaveVideo(CSimpleStringA strVideoName)
 	}
 	else
 	{
-		Dbg("SalesClient connected success!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SalesClient connected success!");
 		SalesRecorderSerVice_SaveVideo_Req req;
 		SalesRecorderSerVice_SaveVideo_Ans ans;
 		req.VideoName = CSimpleStringA2W(strVideoName);
 		rc = m_pSalesRecordClient->SaveVideo(req, ans, 5000);
 		if(Error_Succeed == rc)
 		{
-			Dbg("Save video %s success.", strVideoName.GetData());
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Save video %s success.", strVideoName.GetData());
 		}
 		else
 		{
-			Dbg("Save video %s failed for 0x%08x",strVideoName.GetData(), rc);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Save video %s failed for 0x%08x",strVideoName.GetData(), rc);
 		}
 	}
 
@@ -1408,7 +1408,7 @@ ErrorCodeEnum CITCtrlEntity::StartRemoteRecord(CSimpleStringA strVideoName)
 	if (ConnectToSalesRecord() != Error_Succeed)
 	{
 		rc = Error_DevConnFailed;
-		Dbg("StartRemoteRecord SalesClient connected failed!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("StartRemoteRecord SalesClient connected failed!");
 	}
 	else
 	{
@@ -1418,11 +1418,11 @@ ErrorCodeEnum CITCtrlEntity::StartRemoteRecord(CSimpleStringA strVideoName)
 		rc = m_pSalesRecordClient->StartRemoteRecord(req, ans, 5000);
 		if (Error_Succeed == rc)
 		{
-			Dbg("Start remote record %s success.", strVideoName.GetData());
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Start remote record %s success.", strVideoName.GetData());
 		}
 		else
 		{
-			Dbg("Start remote record %s failed for 0x%08x", strVideoName.GetData(), rc);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Start remote record %s failed for 0x%08x", strVideoName.GetData(), rc);
 		}
 	}
 
@@ -1436,7 +1436,7 @@ ErrorCodeEnum CITCtrlEntity::StopRecord(CSimpleStringA strVideoName)
 	if(ConnectToSalesRecord()!= Error_Succeed)
 	{
 		rc = Error_DevConnFailed;
-		Dbg("StopRecord SalesClient connected failed!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("StopRecord SalesClient connected failed!");
 	}
 	else
 	{
@@ -1445,10 +1445,10 @@ ErrorCodeEnum CITCtrlEntity::StopRecord(CSimpleStringA strVideoName)
 		req.VideoName = CSimpleStringA2W(strVideoName);
 		rc = m_pSalesRecordClient->StopRecord(req, ans, 5000);
 		if(Error_Succeed == rc){
-			Dbg("Stop record %s success.", strVideoName.GetData());
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop record %s success.", strVideoName.GetData());
 		}
 		else{
-			Dbg("Stop record %s failed for 0x%08x",strVideoName.GetData(), rc);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop record %s failed for 0x%08x",strVideoName.GetData(), rc);
 		}
 	}
 
@@ -1462,11 +1462,11 @@ eRecordDeviceState CITCtrlEntity::GetRecordDeviceState()
 	CSimpleStringA camstate;
 	GetFunction()->GetSysVar("CameraState",camstate);
 	if (0 == camstate.GetLength()){
-		Dbg("GetSysVar CameraState failed.");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("GetSysVar CameraState failed.");
 		return eState;
 	}
 	else{
-		Dbg("GetSysVar CameraState is %s.",camstate.GetData());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("GetSysVar CameraState is %s.",camstate.GetData());
 	}
 
 	char cState = camstate[0];
@@ -1651,14 +1651,14 @@ void UIServiceSession::Handle_StartRecordVideo(SpReqAnsContext<UIService_StartRe
 {
 
 	ErrorCodeEnum rc = Error_Succeed;
-	Dbg("return ret rc is 0x%08x, Ans.ErrorCode is 0x%08x, and ErrorMsg is %s.", rc, ctx->Ans.ErrorCode, CSimpleStringW2A(ctx->Ans.ErrorMsg).GetData());
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("return ret rc is 0x%08x, Ans.ErrorCode is 0x%08x, and ErrorMsg is %s.", rc, ctx->Ans.ErrorCode, CSimpleStringW2A(ctx->Ans.ErrorMsg).GetData());
 	ctx->Answer(rc);
 }
 
 void UIServiceSession::Handle_StopRecordVideo(SpReqAnsContext<UIService_StopRecordVideo_Req, UIService_StopRecordVideo_Ans>::Pointer ctx)
 {
 	LogEvent(Severity_Middle,LOG_EVT_UI_STOPRECORD,(LPCTSTR)CSimpleStringW2A(ctx->Req.content));
-	Dbg("Sales Recording flag is %d.", m_pEntity->m_bSalesRecording);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Sales Recording flag is %d.", m_pEntity->m_bSalesRecording);
 
 	ErrorCodeEnum Error = Error_Succeed;
 	if (m_pEntity->m_bSalesRecording){
@@ -1680,14 +1680,14 @@ void UIServiceSession::Handle_StopRecordVideo(SpReqAnsContext<UIService_StopReco
 
 void UIServiceSession::Handle_ShowVideo(SpReqAnsContext<UIService_ShowVideo_Req, UIService_ShowVideo_Ans>::Pointer ctx)
 {
-	Dbg("show video,videoname=%s",(LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("show video,videoname=%s",(LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
 	ErrorCodeEnum Error = m_pEntity->PlayVideo(CSimpleStringW2A(ctx->Req.VideoName));
 	ctx->Answer(Error);
 }
 
 void UIServiceSession::Handle_SaveVideo(SpReqAnsContext<UIService_SaveVideo_Req, UIService_SaveVideo_Ans>::Pointer ctx)
 {
-	Dbg("save video,videoname=%s",CSimpleStringW2A(ctx->Req.VideoName).GetData());
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("save video,videoname=%s",CSimpleStringW2A(ctx->Req.VideoName).GetData());
 	ErrorCodeEnum Error = m_pEntity->SaveVideo(CSimpleStringW2A(ctx->Req.VideoName));
 	ctx->Answer(Error);
 }
@@ -1695,7 +1695,7 @@ void UIServiceSession::Handle_SaveVideo(SpReqAnsContext<UIService_SaveVideo_Req,
 void UIServiceSession::Handle_DeleteVideo(SpReqAnsContext<UIService_DeleteVideo_Req, UIService_DeleteVideo_Ans>::Pointer ctx)
 {
 	LogEvent(Severity_Middle,LOG_EVT_UI_DELETEVIDEO,(LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
-	Dbg("delete video,videoname=%s",(LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("delete video,videoname=%s",(LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
 	ctx->Answer(Error_Succeed);
 }
 
@@ -1703,13 +1703,13 @@ void UIServiceSession::Handle_DeleteVideo(SpReqAnsContext<UIService_DeleteVideo_
 void UIServiceSession::Handle_StartPhotograph(SpOnewayCallContext<UIService_StartPhotograph_Info>::Pointer ctx)
 {
 	LogEvent(Severity_Middle,LOG_EVT_UI_STARTPHOTOGRAPH,"StartPhotograph");
-	Dbg("Start Photograph.");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Start Photograph.");
 }
 
 void UIServiceSession::Handle_StopPhotograph(SpOnewayCallContext<UIService_StopPhotograph_Info>::Pointer ctx)
 {
 	LogEvent(Severity_Middle,LOG_EVT_UI_STOPPHOTOGRAPH,"StopPhotograph");
-	Dbg("Stop Photograph.");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop Photograph.");
 }
 
 // add by ly
@@ -1717,7 +1717,7 @@ void UIServiceSession::Handle_StartPlayVideo(SpReqAnsContext<UIService_StartPlay
 {
 #ifdef RVC_OS_WIN
 	ErrorCodeEnum Error = m_pEntity->StartPlayVideo(ctx->Req.CfgInx, ctx->Req.WndX, ctx->Req.WndY, ctx->Req.WndWidth, ctx->Req.WndHeight, 800);
-	Dbg("Start Play Local Video!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Start Play Local Video!");
 	ctx->Answer(Error);
 #else
 	ctx->Answer(Error_Succeed);
@@ -1727,14 +1727,14 @@ void UIServiceSession::Handle_StartPlayVideo(SpReqAnsContext<UIService_StartPlay
 void UIServiceSession::Handle_StartPlayAudio(SpReqAnsContext<UIService_StartPlayAudio_Req, UIService_StartPlayAudio_Ans>::Pointer ctx)
 {
 	ErrorCodeEnum Error = m_pEntity->StartPlayAudio(ctx->Req.AudioNames, 800);
-	Dbg("Start Play Local Audio!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Start Play Local Audio!");
 	ctx->Answer(Error);
 }
 
 void UIServiceSession::Handle_StartPlayImage(SpReqAnsContext<UIService_StartPlayImage_Req, UIService_StartPlayImage_Ans>::Pointer ctx)
 {
 	ErrorCodeEnum Error = m_pEntity->StartPlayImage(ctx->Req.CfgInx, ctx->Req.WndX, ctx->Req.WndY, ctx->Req.WndWidth, ctx->Req.WndHeight, 800);
-	Dbg("Start Play Local Image!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Start Play Local Image!");
 	ctx->Answer(Error);
 }
 
@@ -1742,7 +1742,7 @@ void UIServiceSession::Handle_StopPlayVideo(SpReqAnsContext<UIService_StopPlayVi
 {
 #ifdef RVC_OS_WIN
 	ErrorCodeEnum Error = m_pEntity->StopPlayVideo(ctx->Req.CfgInx, 800);
-	Dbg("Stop Play Local Video!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop Play Local Video!");
 	ctx->Answer(Error);
 #else
 	ctx->Answer(Error_Succeed);
@@ -1752,14 +1752,14 @@ void UIServiceSession::Handle_StopPlayVideo(SpReqAnsContext<UIService_StopPlayVi
 void UIServiceSession::Handle_StopPlayAudio(SpReqAnsContext<UIService_StopPlayAudio_Req, UIService_StopPlayAudio_Ans>::Pointer ctx)
 {
 	ErrorCodeEnum Error = m_pEntity->StopPlayAudio(800);
-	Dbg("Stop Play Local Audio!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop Play Local Audio!");
 	ctx->Answer(Error);
 }
 
 void UIServiceSession::Handle_StopPlayImage(SpReqAnsContext<UIService_StopPlayImage_Req, UIService_StopPlayImage_Ans>::Pointer ctx)
 {
 	ErrorCodeEnum Error = m_pEntity->StopPlayImage(ctx->Req.CfgInx, 800);
-	Dbg("Stop Play Local Image!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop Play Local Image!");
 	ctx->Answer(Error);
 }
 
@@ -1768,7 +1768,7 @@ void UIServiceSession::Handle_SendOperateState(SpOnewayCallContext<UIService_Sen
 {
 	/// override by user
 	LogEvent(Severity_Middle,LOG_EVT_UI_SENDOPERATESTATE,"UI send operate state");
-	Dbg("UI send operate state!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("UI send operate state!");
 }
 
 void UIServiceSession::Handle_CheckContinuRecord( SpReqAnsContext<UIService_CheckContinuRecord_Req, UIService_CheckContinuRecord_Ans>::Pointer ctx )
@@ -1786,7 +1786,7 @@ void UIServiceSession::Handle_StartContinuRecord( SpReqAnsContext<UIService_Star
 void UIServiceSession::Handle_StopContinuRecord( SpReqAnsContext<UIService_StopContinuRecord_Req, UIService_StopContinuRecord_Ans>::Pointer ctx )
 {
 	CSimpleStringA videoname = (LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName);
-	Dbg("stop continue record,videoname=%s",(LPCTSTR)videoname);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop continue record,videoname=%s",(LPCTSTR)videoname);
 	LogEvent(Severity_Middle,LOG_EVT_UI_STOP_CONTINURECORD,(LPCTSTR)videoname);
 	ctx->Answer(Error_Succeed);
 }
@@ -1804,89 +1804,89 @@ void UIServiceSession::Handle_HideOnlineVideo(SpOnewayCallContext<UIService_Hide
 {
 	/// override by user
 	LogEvent(Severity_Middle,LOG_EVT_UI_HIDEONLINEVIDEO,"UI send Hide online video");
-	Dbg("UI send Hide online video");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("UI send Hide online video");
 }
 
 void UIServiceSession::Handle_ShowOnlineVideo(SpOnewayCallContext<UIService_ShowOnlineVideo_Info>::Pointer ctx)
 {
 	/// override by user
 	LogEvent(Severity_Middle,LOG_EVT_UI_SHOWONLINEVIDEO,"UI send show online video");
-	Dbg("UI send show online video");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("UI send show online video");
 }
 
 void UIServiceSession::Handle_HideLocalVideo(SpOnewayCallContext<UIService_HideLocalVideo_Info>::Pointer ctx)
 {
 	/// override by user
 	LogEvent(Severity_Middle,LOG_EVT_UI_HIDELOCALVIDEO,"UI send Hide local video");
-	Dbg("UI send Hide local video");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("UI send Hide local video");
 }
 
 void UIServiceSession::Handle_ShowLocalVideo(SpOnewayCallContext<UIService_ShowLocalVideo_Info>::Pointer ctx)
 {
 	/// override by user
 	LogEvent(Severity_Middle,LOG_EVT_UI_SHOWLOCALVIDEO,"UI send show local video");
-	Dbg("UI send show local video");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("UI send show local video");
 }
 
 void UIServiceSession::Handle_HidePersonArea(SpOnewayCallContext<UIService_HidePersonArea_Info>::Pointer ctx)
 {
 	/// override by user
 	LogEvent(Severity_Middle,LOG_EVT_UI_HIDEPERSONAREA,"UI send Hide Person area");
-	Dbg("UI send Hide Person area");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("UI send Hide Person area");
 }
 void UIServiceSession::Handle_ShowPersonArea(SpOnewayCallContext<UIService_ShowPersonArea_Info>::Pointer ctx)
 {
 	/// override by user
 	LogEvent(Severity_Middle,LOG_EVT_UI_SHOWPERSONAREA,"UI send show Person area");
-	Dbg("UI send show Person area");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("UI send show Person area");
 }
 
 
 void UIServiceSession::Handle_AnswerPacket(SpReqAnsContext<UIService_AnswerPacket_Req, UIService_AnswerPacket_Ans>::Pointer ctx)
 {
-	Dbg("Send Answer to Mobile,%s",ctx->Req.Packet);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Send Answer to Mobile,%s",ctx->Req.Packet);
 	m_pEntity->SendAnswertoMobile(ctx->Req.Packet);
 	ctx->Answer(Error_Succeed);
 }
 
 void UIServiceSession::Handle_GetLocalVideoVolume( SpReqAnsContext<UIService_GetLocalVideoVolume_Req, UIService_GetLocalVideoVolume_Ans>::Pointer ctx )
 {
-	Dbg("Get Local Video Volume with CfgInx:%d!", ctx->Req.CfgInx);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Get Local Video Volume with CfgInx:%d!", ctx->Req.CfgInx);
 	ErrorCodeEnum error = m_pEntity->GetLocalVideoVolume(ctx->Req.CfgInx, ctx->Ans.Volume, 2000);
 	ctx->Answer(error);
 }
 
 void UIServiceSession::Handle_SetLocalVideoVolume( SpReqAnsContext<UIService_SetLocalVideoVolume_Req, UIService_SetLocalVideoVolume_Ans>::Pointer ctx )
 {
-	Dbg("Set Local Video Volume with CfgInx:%d, Volume:%d!", ctx->Req.CfgInx, ctx->Req.Volume);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Set Local Video Volume with CfgInx:%d, Volume:%d!", ctx->Req.CfgInx, ctx->Req.Volume);
 	ErrorCodeEnum error = m_pEntity->SetLocalVideoVolume(ctx->Req.CfgInx, ctx->Req.Volume, 2000);
 	ctx->Answer(error);
 }
 
 void UIServiceSession::Handle_GetLocalAudioVolume(SpReqAnsContext<UIService_GetLocalAudioVolume_Req, UIService_GetLocalAudioVolume_Ans>::Pointer ctx)
 {
-	Dbg("Get Local Audio Volume");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Get Local Audio Volume");
 	ErrorCodeEnum error = m_pEntity->GetLocalAudioVolume(ctx->Ans.Volume, 2000);
 	ctx->Answer(error);
 }
 
 void UIServiceSession::Handle_SetLocalAudioVolume(SpReqAnsContext<UIService_SetLocalAudioVolume_Req, UIService_SetLocalAudioVolume_Ans>::Pointer ctx)
 {
-	Dbg("Set Local Audio Volume with Volume:%d!", ctx->Req.Volume);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Set Local Audio Volume with Volume:%d!", ctx->Req.Volume);
 	ErrorCodeEnum error = m_pEntity->SetLocalAudioVolume(ctx->Req.Volume, 2000);
 	ctx->Answer(error);
 }
 
 void UIServiceSession::Handle_SendBusinessDesktopCmd(SpReqAnsContext<UIService_SendBusinessDesktopCmd_Req, UIService_SendBusinessDesktopCmd_Ans>::Pointer ctx)
 {
-	Dbg("Handle_SendBusinessDesktopCmd : %s %s", ctx->Req.xapName, ctx->Req.command);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Handle_SendBusinessDesktopCmd : %s %s", ctx->Req.xapName, ctx->Req.command);
 	ErrorCodeEnum error = m_pEntity->SendBusinessDesktopCmd(ctx->Req.xapName, ctx->Req.command);
 	ctx->Answer(error);
 }
 
 void UIServiceSession::Handle_VideoAppendWaterMark(SpReqAnsContext<UIService_VideoAppendWaterMark_Req, UIService_VideoAppendWaterMark_Ans>::Pointer ctx)
 {
-	Dbg("Handle_VideoAppendWaterMark :video name is %s,append water mark is %s", (LPCTSTR)CSimpleStringW2A(ctx->Req.videoName), (LPCTSTR)CSimpleStringW2A(ctx->Req.appendstr));
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Handle_VideoAppendWaterMark :video name is %s,append water mark is %s", (LPCTSTR)CSimpleStringW2A(ctx->Req.videoName), (LPCTSTR)CSimpleStringW2A(ctx->Req.appendstr));
 	CSimpleStringA strParam = CSimpleStringA::Format("%s|%s", (LPCTSTR)CSimpleStringW2A(ctx->Req.videoName), (LPCTSTR)CSimpleStringW2A(ctx->Req.appendstr));
 	LogEvent(Severity_Middle,LOG_EVT_UI_VIDEOAPPENDWATERMARK,(LPCTSTR)strParam);
 	ctx->Answer(Error_Succeed);
@@ -1898,7 +1898,7 @@ void UIServiceSession::Handle_StartRemoteRecord(SpReqAnsContext<UIService_StartR
 
 	CSimpleStringA camstate;
 	m_pEntity->GetFunction()->GetSysVar("CameraState",camstate);
-	Dbg("start remote record, camstate=%s.",(LPCTSTR)camstate);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start remote record, camstate=%s.",(LPCTSTR)camstate);
 	if (camstate[0] == 'N' || camstate[0] == 'O') {
 		rc = m_pEntity->StartRemoteRecord(m_pEntity->EncryptVideoNameCarNumber(CSimpleStringW2A(ctx->Req.VideoName)));
 		if (Error_Succeed == rc) {
@@ -1936,7 +1936,7 @@ void UIServiceSession::Handle_StartRemoteRecord(SpReqAnsContext<UIService_StartR
 
 void UIServiceSession::Handle_StopRemoteRecord(SpReqAnsContext<UIService_StopRemoteRecord_Req, UIService_StopRemoteRecord_Ans>::Pointer ctx)
 {
-	Dbg("stop remote record.");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop remote record.");
 	LogEvent(Severity_Middle,LOG_EVT_UI_STOPREMOTERECORD,(LPCTSTR)(m_pEntity->EncryptVideoNameCarNumber(CSimpleStringW2A(ctx->Req.content))));
 	m_pEntity->m_bSalesRecording = FALSE;
 	ErrorCodeEnum Error = m_pEntity->StopRecord(CSimpleStringW2A(ctx->Req.content));
@@ -1982,7 +1982,7 @@ void UIServiceSession::Handle_AjustVideoPreviewSize(SpReqAnsContext<UIService_Aj
 		pSipphoneClient->SafeDelete();
 		pSipphoneClient = NULL;
 		Error = Error_DevConnFailed;
-		Dbg("Connect SipPhone entity failed!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Connect SipPhone entity failed!");
 		ctx->Ans.ErrorCode = Error_DevConnFailed;
 		ctx->Ans.ErrorMsg = CSimpleStringA2W("Connect SipPhone entity failed.");
 	}
@@ -1990,7 +1990,7 @@ void UIServiceSession::Handle_AjustVideoPreviewSize(SpReqAnsContext<UIService_Aj
 		char strvideoparam[MAX_PATH] = {0};
 		snprintf(strvideoparam, MAX_PATH, "%d@%d@%d@%d", ctx->Req.leftx, ctx->Req.lefty, ctx->Req.width, ctx->Req.height);
 		LogEvent(Severity_Middle, LOG_EVT_UI_ADJUSTVIDEOECHOSIZE, strvideoparam);
-		Dbg("adjust video preview size, param is %s.", strvideoparam);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("adjust video preview size, param is %s.", strvideoparam);
 		ctx->Ans.ErrorCode = 0;
 		ctx->Ans.ErrorMsg = CSimpleStringA2W("");
 	}
@@ -2000,7 +2000,7 @@ void UIServiceSession::Handle_AjustVideoPreviewSize(SpReqAnsContext<UIService_Aj
 
 void UIServiceSession::Handle_StopShowVideo(SpReqAnsContext<UIService_StopShowVideo_Req, UIService_StopShowVideo_Ans>::Pointer ctx)
 {
-	Dbg("stop show video,videoname=%s",(LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop show video,videoname=%s",(LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName));
 	ErrorCodeEnum Error = m_pEntity->StopShowVideo(CSimpleStringW2A(ctx->Req.VideoName));
 	ctx->Answer(Error);
 }
@@ -2008,7 +2008,7 @@ void UIServiceSession::Handle_StopShowVideo(SpReqAnsContext<UIService_StopShowVi
 
 void UIServiceSession::Handle_StartPlaySalesRecord(SpReqAnsContext<UIService_StartPlaySalesRecord_Req, UIService_StartPlaySalesRecord_Ans>::Pointer ctx)
 {
-	Dbg("start play sales record, videoname=%s, WndX=%d, WndY=%d, WndWidth=%d, WndHeight=%d.",(LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName), ctx->Req.WndX, ctx->Req.WndY, ctx->Req.WndWidth, ctx->Req.WndHeight);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start play sales record, videoname=%s, WndX=%d, WndY=%d, WndWidth=%d, WndHeight=%d.",(LPCTSTR)CSimpleStringW2A(ctx->Req.VideoName), ctx->Req.WndX, ctx->Req.WndY, ctx->Req.WndWidth, ctx->Req.WndHeight);
 	ErrorCodeEnum Error = m_pEntity->StartPlaySalesRecordVideo(CSimpleStringW2A(ctx->Req.VideoName), ctx->Req.WndX, ctx->Req.WndY, ctx->Req.WndWidth, ctx->Req.WndHeight);
 	ctx->Answer(Error);
 }
@@ -2061,7 +2061,7 @@ void UIServiceSession::Handle_StartPlayNotice(SpReqAnsContext<UIService_StartPla
 		req.WndHeight = ctx->Req.WndHeight;
 		req.VideoName = ctx->Req.VideoName;
 		Error = m_pEntity->GetLocalPlayClient()->StartPlayNotice(req, ans, 800);
-		Dbg("StartPlayNotice Result = 0x%08x.", Error);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("StartPlayNotice Result = 0x%08x.", Error);
 		ctx->Ans.ErrorCode = Error;
 	}
 

+ 2 - 2
Module/mod_localmediaplay/AdvertBase/AdvertSync.cpp

@@ -5,7 +5,7 @@ vector<ResourceListRet> vaildAdvert;
 
 void CAdvertSyncConnection::OnDisconnect()
 {
-	Dbg("connection disconnected");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("connection disconnected");
 }
 
 ErrorCodeEnum CAdvertSyncConnection::QryVaildAdvertList(const char *terminalNo, const char resourceType, vector<ResourceListRet> &resourceList)
@@ -90,7 +90,7 @@ void CAdvertSyncConnection::OnPkgAnswer(const CSmartPointer<IPackage> &pRecvPkg)
 	}
 	else
 	{
-		Dbg("unknown service code!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("unknown service code!");
 		OnDisconnect();
 	}
 }

+ 23 - 23
Module/mod_localmediaplay/AdvertManage/MediaManage.cpp

@@ -9,13 +9,13 @@ mediaManage::mediaManage()
 	m_curParse.clear();
 	if (checkDirExist(DEFAULT_RESOURSE_PATH))
 	{
-		Dbg("Set defaultAdvertPath:%s, defaultDownloadPath:%s", DEFAULT_RESOURSE_PATH, DEFAULT_DOWNLOAD_PATH);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Set defaultAdvertPath:%s, defaultDownloadPath:%s", DEFAULT_RESOURSE_PATH, DEFAULT_DOWNLOAD_PATH);
 		setDefaultAddvertPath(string(DEFAULT_RESOURSE_PATH));
 		setDefaultDownloadPath(string(DEFAULT_DOWNLOAD_PATH));
 	}
 	else
 	{
-		Dbg("Set defaultAdvertPath:%s, defaultDownloadPath:%s", DEFAULT_RESOURSE_PATH_C, DEFAULT_DOWNLOAD_PATH_C);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Set defaultAdvertPath:%s, defaultDownloadPath:%s", DEFAULT_RESOURSE_PATH_C, DEFAULT_DOWNLOAD_PATH_C);
 		setDefaultAddvertPath(string(DEFAULT_RESOURSE_PATH_C));
 		setDefaultDownloadPath(string(DEFAULT_DOWNLOAD_PATH_C));
 	}
@@ -54,17 +54,17 @@ size_t mediaManage::GetPlayListByLocal(vector<ResourceParse>& resourceList)
 #else
 	for (vector<ResourceParse>::iterator it = m_localList.begin(); it != m_localList.end(); it++)
 	{
-		Dbg("play extend %c:%s, %s, %s, %s", it->type, it->resourcePath.c_str(), it->videoNames.c_str(), it->vaildTime.c_str(), it->playTime.c_str());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("play extend %c:%s, %s, %s, %s", it->type, it->resourcePath.c_str(), it->videoNames.c_str(), it->vaildTime.c_str(), it->playTime.c_str());
 		if (checkInVaildTime(it->vaildTime, true) && checkInPlayTime(it->playTime, true)) {
 			resourceList.push_back(*it);
 			uNum++;
 		}
 	}
-	Dbg("uNum is %d, m_localList size is %d, resourceList size is %d", uNum, m_localList.size(), resourceList.size());
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("uNum is %d, m_localList size is %d, resourceList size is %d", uNum, m_localList.size(), resourceList.size());
 
 	for (vector<ResourceParse>::iterator i = resourceList.begin(); i != resourceList.end(); i++)
 	{
-		Dbg("begin play extend %c:%s, %s", i->type, i->resourcePath.c_str(), i->videoNames.c_str());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("begin play extend %c:%s, %s", i->type, i->resourcePath.c_str(), i->videoNames.c_str());
 	}
 #endif // _WIN32
 
@@ -78,7 +78,7 @@ size_t mediaManage::GetPlayListByLocal(CResourceParse** ResourceArr, size_t uSiz
 
 	for (vector<ResourceParse>::iterator it = m_localList.begin(); it != m_localList.end() && uNum < uSize; it++)
 	{
-		Dbg("new deep copy play extend %c:%s, %s, %s, %s", it->type, it->resourcePath.c_str(), it->videoNames.c_str(), it->vaildTime.c_str(), it->playTime.c_str());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("new deep copy play extend %c:%s, %s, %s, %s", it->type, it->resourcePath.c_str(), it->videoNames.c_str(), it->vaildTime.c_str(), it->playTime.c_str());
 		if (checkInVaildTime(it->vaildTime, true) && checkInPlayTime(it->playTime, true)) {
 			CResourceParse* pNode = new CResourceParse();
 			pNode->type = it->type;
@@ -112,9 +112,9 @@ size_t mediaManage::GetPlayListByLocal(CResourceParse** ResourceArr, size_t uSiz
 				memcpy(pNode->playTime, it->playTime.c_str(), it->playTime.length());
 			}
 			ResourceArr[uNum++] = pNode;
-			Dbg("aftercopy play extend pNode->type=0x%08x:pNode->presourcePath=0x%08x, pNode->pvideoNames=0x%08x, pNode->pvaildTime=0x%08x, pNode->playTime=0x%08x", pNode->type, pNode->presourcePath, pNode->pvideoNames, pNode->pvaildTime, pNode->playTime);
-			Dbg("aftercopy play extend %c:%s, %s, %s, %s", pNode->type, pNode->presourcePath, pNode->pvideoNames, pNode->pvaildTime, pNode->playTime);
-			Dbg("%s:%d    ResourceList[%d] address is 0x%08x, pNode address is 0x%08x.", __FUNCTION__, __LINE__, uNum-1, ResourceArr[uNum-1], pNode);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("aftercopy play extend pNode->type=0x%08x:pNode->presourcePath=0x%08x, pNode->pvideoNames=0x%08x, pNode->pvaildTime=0x%08x, pNode->playTime=0x%08x", pNode->type, pNode->presourcePath, pNode->pvideoNames, pNode->pvaildTime, pNode->playTime);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("aftercopy play extend %c:%s, %s, %s, %s", pNode->type, pNode->presourcePath, pNode->pvideoNames, pNode->pvaildTime, pNode->playTime);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d    ResourceList[%d] address is 0x%08x, pNode address is 0x%08x.", __FUNCTION__, __LINE__, uNum-1, ResourceArr[uNum-1], pNode);
 			
 		}
 	}
@@ -130,7 +130,7 @@ size_t mediaManage::GetPlayListByLocal(rvcResourceParse_t* ResourceArr, size_t u
 	for (vector<ResourceParse>::iterator it = m_localList.begin(); it != m_localList.end() && uNum < uSize; it++)
 	{
 		if (false == bloged){
-			Dbg("new deep copy play extend %c:%s, %s, %s, %s", it->type, it->resourcePath.c_str(), it->videoNames.c_str(), it->vaildTime.c_str(), it->playTime.c_str());
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("new deep copy play extend %c:%s, %s, %s, %s", it->type, it->resourcePath.c_str(), it->videoNames.c_str(), it->vaildTime.c_str(), it->playTime.c_str());
 		}
 		if (checkInVaildTime(it->vaildTime, true) && checkInPlayTime(it->playTime, true) && IsResourceExist(it->resourcePath, it->videoNames)) {
 			rvcResourceParse_t* pNode = ResourceArr+uNum;
@@ -205,7 +205,7 @@ bool mediaManage::AddResourceList(vector<string> resourceList)
 		string dirName = i->substr(0, pos);
 		string fileName = m_downloadPath + SPLIT_SLASH_STR + *i;
 		string dirPath = m_addvertPath + SPLIT_SLASH_STR + dirName;
-		Dbg("dirName:%s, fileName:%s, dirPath:%s", dirName.c_str(), fileName.c_str(), dirPath.c_str());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("dirName:%s, fileName:%s, dirPath:%s", dirName.c_str(), fileName.c_str(), dirPath.c_str());
 
 		wstring wfileName, wdirPath;
 		StringToWstring(wfileName, fileName);
@@ -214,7 +214,7 @@ bool mediaManage::AddResourceList(vector<string> resourceList)
 
 		if (!checkFileExist(dirPath))
 		{
-			Dbg("dir %s not exist!", dirPath.c_str());
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("dir %s not exist!", dirPath.c_str());
 			continue;//ѹ���ļ��в�����
 		}
 /*
@@ -227,14 +227,14 @@ bool mediaManage::AddResourceList(vector<string> resourceList)
 		string configPath = "";
 		if (!findVaildConfig(dirPath, configPath))
 		{
-			Dbg("can not find config file in %s//%s", dirPath.c_str(), configPath.c_str());
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("can not find config file in %s//%s", dirPath.c_str(), configPath.c_str());
 			continue;//�����������
 		}
 
 		vector<ResourceParse> mediaList;
 		if (!parseResourceIni(configPath.c_str(), mediaList))
 		{
-			Dbg("parse config %s fail!", configPath.c_str());
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("parse config %s fail!", configPath.c_str());
 			continue;//�����ļ���ȡʧ��
 		}
 
@@ -265,25 +265,25 @@ void mediaManage::InitResourceListByLocal()
 	vector<ResourceParse> headList, branchList, networkList, allList;
 
 	if (!checkFileExist(headFile)) {
-		Dbg("head config %s not exist!", headFile.c_str());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("head config %s not exist!", headFile.c_str());
 	}
 	else if (!parseResourceIni(headFile.c_str(), headList)) {
-		Dbg("parse head config %s fail!", headFile.c_str());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("parse head config %s fail!", headFile.c_str());
 	}
 
 	if (!checkFileExist(branchFile)) {
-		Dbg("branch config %s not exist!", branchFile.c_str());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("branch config %s not exist!", branchFile.c_str());
 	}
 	else if (!parseResourceIni(branchFile.c_str(), branchList)) {
-		Dbg("parse branch config %s fail!", branchFile.c_str());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("parse branch config %s fail!", branchFile.c_str());
 	}
 
 
 	if (!checkFileExist(networkFile)) {
-		Dbg("network config %s not exist!", networkFile.c_str());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("network config %s not exist!", networkFile.c_str());
 	}
 	else if (!parseResourceIni(networkFile.c_str(), networkList)) {
-		Dbg("parse network config %s fail!", networkFile.c_str());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("parse network config %s fail!", networkFile.c_str());
 	}
 		
 	m_localList.clear();
@@ -312,7 +312,7 @@ void mediaManage::InitResourceListByLocal()
 		m_localList.push_back(*it);
 		unetworkList++;
 	}
-	Dbg("headList size is %d, branchList size is %d, networkList size is %d, and m_localList size is %u.", uheadList, ubranchList, unetworkList, m_localList.size());
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("headList size is %d, branchList size is %d, networkList size is %d, and m_localList size is %u.", uheadList, ubranchList, unetworkList, m_localList.size());
 
 #endif // RVC_OS_WIN
 	
@@ -414,12 +414,12 @@ void mediaManage::clearOutdataResource()
 		for (vector<string>::iterator i = needDelete.begin(); i != needDelete.end(); i++)
 		{
 			string path = m_addvertPath + SPLIT_SLASH_STR + *i;
-			Dbg("remove Dir %s %s!", *i, removeDir(path) ? "success" : "fail");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("remove Dir %s %s!", *i, removeDir(path) ? "success" : "fail");
 		}
 	}
 	catch (exception* e)
 	{
-		Dbg("remove Dir exception:%s", e->what());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("remove Dir exception:%s", e->what());
 	}
 
 }

+ 120 - 120
Module/mod_localmediaplay/mod_localmediaplay.cpp

@@ -113,7 +113,7 @@ CLocalMediaPlayEntity::~CLocalMediaPlayEntity()
 #else
 	m_scanexitflag = true;
 	if (0 == pthread_join(m_scanThreadId, NULL)) {
-		Dbg("pthread join scanThreadId success.");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("pthread join scanThreadId success.");
 	}
 	m_bgetflag = false;
 	m_bgetico = false;
@@ -155,7 +155,7 @@ void CLocalMediaPlayEntity::setMediaPath()
 CServerSessionBase* CLocalMediaPlayEntity::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 CLocalMediaPlaySession(this, m_id_seq++);
 }
 
@@ -177,7 +177,7 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
 	ErrorCodeEnum Error = Error_Succeed;
 	Error = GetFunction()->GetPath("ADData", strRootPath);
 	if (Error != Error_Succeed) {
-		Dbg("Fail to get local media root path!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Fail to get local media root path!");
 		return;
 	}
 
@@ -197,9 +197,9 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
 				table.AddEntryInt(sectionList[i].GetData(), "scanTime", scanTime, 600);
 				table.AddEntryInt(sectionList[i].GetData(), "removeOldTime", removeOldTime, 1800);
 				if (Error_Succeed == table.Load(tempConfig))
-					Dbg("runDebug:%s, scanTime:%d", IS_DEBUG ? "true" : "false", scanTime);
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("runDebug:%s, scanTime:%d", IS_DEBUG ? "true" : "false", scanTime);
 				else
-					Dbg("General load fail!");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("General load fail!");
 
 				if (removeOldTime < 1800)
 				{
@@ -218,7 +218,7 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
 
 				CSimpleStringA imgPath = strRootPath + SPLIT_SLASH_STR +"Image" + SPLIT_SLASH_STR;
 				strncpy(curImg.strRootPath, (LPCSTR)imgPath, sizeof(curImg.strRootPath));
-				Dbg("curSection: %s, config.strRootPath: %s", sectionList[i].GetData(), curImg.strRootPath);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("curSection: %s, config.strRootPath: %s", sectionList[i].GetData(), curImg.strRootPath);
 
 				table.AddEntryBoolean(sectionList[i].GetData(), "FullScreen", curImg.bFullScreen, false);
 				table.AddEntryBoolean(sectionList[i].GetData(), "PrimMonitor", curImg.bPrimMonitor, false);
@@ -226,9 +226,9 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
 				table.AddEntryInt(sectionList[i].GetData(), "PlayInterval", curImg.nPlayInterval, 0);
 				table.AddEntryString(sectionList[i].GetData(), "ImageNames", strFileNames, "");
 				if (Error_Succeed == table.Load(tempConfig))
-					Dbg("Image Succeed to LoadConfig!");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Image Succeed to LoadConfig!");
 				else
-					Dbg("Image Fail to LoadConfig!");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Image Fail to LoadConfig!");
 
 				char *Tmp = new char[strFileNames.GetLength() + 1];
 				strcpy(Tmp, (LPCSTR)strFileNames);
@@ -241,7 +241,7 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
 					++pStr; ++FileCount;
 				}
 				curImg.nFileCnt = FileCount;
-				Dbg("Image config.nFileCnt = %d!", FileCount);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Image config.nFileCnt = %d!", FileCount);
 				for (int i = 0; i != FileCount; ++i)
 				{
 					strcpy(curImg.strFileNames[i], Result[i]);
@@ -265,7 +265,7 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
 
 				CSimpleStringA videoPath = strRootPath + SPLIT_SLASH_STR +"Video" + SPLIT_SLASH_STR;
 				strcpy(curVideo.strRootPath, (LPCSTR)videoPath);
-				Dbg("config.strRootPath: %s", curVideo.strRootPath);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("config.strRootPath: %s", curVideo.strRootPath);
 
 				CSimpleStringA strRunTime_S, strRunTime_E;
 				
@@ -279,9 +279,9 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
 				table.AddEntryInt(sectionList[i].GetData(), "PlayInterval", curVideo.nPlayInterval, 0);
 				table.AddEntryString(sectionList[i].GetData(), "VideoNames", strFileNames, "");
 				if (Error_Succeed == table.Load(tempConfig))
-					Dbg("Succeed to LoadWmpConfig!");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to LoadWmpConfig!");
 				else
-					Dbg("Fail to LoadWmpConfig!");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Fail to LoadWmpConfig!");
 
 				curVideo.nVolume = 50;
 				Error = GetFunction()->OpenConfig(Config_Run, tempConfig);
@@ -294,9 +294,9 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
 				}
 
 				strcpy(curVideo.strVideoRunTime_S, (LPCSTR)strRunTime_S);
-				Dbg("config.strVideoRunTime_S: %s", (LPCSTR)strRunTime_S);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("config.strVideoRunTime_S: %s", (LPCSTR)strRunTime_S);
 				strcpy(curVideo.strVideoRunTime_E, (LPCSTR)strRunTime_E);
-				Dbg("config.strVideoRunTime_E: %s", (LPCSTR)strRunTime_E);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("config.strVideoRunTime_E: %s", (LPCSTR)strRunTime_E);
 
 				char *Tmp = new char[strFileNames.GetLength() + 1];
 				strcpy(Tmp, (LPCSTR)strFileNames);
@@ -309,8 +309,8 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
 					++pStr; ++FileCount;
 				}
 				curVideo.nFileCnt = FileCount;
-				Dbg("Wmp config.strFileNames = %s!", (LPCSTR)strFileNames);
-				Dbg("Wmp config.nFileCnt = %d!", FileCount);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Wmp config.strFileNames = %s!", (LPCSTR)strFileNames);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Wmp config.nFileCnt = %d!", FileCount);
 				for (int i = 0; i != FileCount; ++i)
 					strcpy(curVideo.strFileNames[i], Result[i]);
 				delete[] Tmp; Tmp = NULL;
@@ -332,7 +332,7 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
 
 				CSimpleStringA audioPath = strRootPath + SPLIT_SLASH_STR +"Audio" + SPLIT_SLASH_STR;
 				strcpy(curAudio.strRootPath, (LPCSTR)audioPath);
-				Dbg("config.strRootPath: %s", curAudio.strRootPath);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("config.strRootPath: %s", curAudio.strRootPath);
 
 				table.AddEntryInt(sectionList[i], "PlayCount", curAudio.nPlayCnt, 0);
 				table.AddEntryInt(sectionList[i], "PlayInterval", curAudio.nPlayInterval, 0);
@@ -344,9 +344,9 @@ void CLocalMediaPlayEntity::loadDefaultMedia()
 					curAudio.nVolume = m_defaultVolum;
 
 				if (Error_Succeed == table.Load(tempConfig))
-					Dbg("Succeed to LoadWmpConfig!");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to LoadWmpConfig!");
 				else
-					Dbg("Fail to LoadWmpConfig!");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Fail to LoadWmpConfig!");
 
 #ifdef RVC_OS_WIN
 				m_defaultAudio.push_back(curAudio);
@@ -365,7 +365,7 @@ BOOL CLocalMediaPlayEntity::LoadPlayConfig(CWmpPlayConfig& config, int CfgInx)
 {
 	if (CfgInx >= MAX_PLAY_CHANNELS || CfgInx < 0)
 	{
-		Dbg("Invalid CfgInx while LoadConfig!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Invalid CfgInx while LoadConfig!");
 		return FALSE;
 	}
 
@@ -388,7 +388,7 @@ BOOL CLocalMediaPlayEntity::LoadPlayConfig(CImgPlayConfig& config, int CfgInx)
 {
 	if (CfgInx >= m_defaultImg.size() || CfgInx < 0)
 	{
-		Dbg("Invalid CfgInx while LoadConfig!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Invalid CfgInx while LoadConfig!");
 		return FALSE;
 	}
 
@@ -419,7 +419,7 @@ int CLocalMediaPlayEntity::LoadPlayConfig(CMediaPlayConfig& config, int CfgInx)
 {
 	if (CfgInx >= MAX_PLAY_CHANNELS || CfgInx < 0)
 	{
-		Dbg("Invalid CfgInx while LoadConfig!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Invalid CfgInx while LoadConfig!");
 		return -1;
 	}
 
@@ -442,7 +442,7 @@ int CLocalMediaPlayEntity::LoadPlayConfig(CPicPlayConfig& config, int CfgInx)
 {
 	if (CfgInx >= m_defaultPic.size() || CfgInx < 0)
 	{
-		Dbg("Invalid CfgInx while LoadConfig!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Invalid CfgInx while LoadConfig!");
 		return -1;
 	}
 
@@ -478,19 +478,19 @@ void CLocalMediaPlayEntity::MediaPlayFinished(int iMediaType)
 		AudioPlayRet ret;
 		ret.AudioNames = m_lastPlayAudio.c_str();
 		ret.ret = true;
-		Dbg("stop play audio %s success.", ret.AudioNames.GetData());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop play audio %s success.", ret.AudioNames.GetData());
 		if (false == m_buserstopaudio) {
 			SpSendBroadcast(GetFunction(), eMsg_AudioPlayRet, eMsgSig_AudioPlayRet, ret);
 		}
 		else {
-			Dbg("user stop, not broadcast!");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("user stop, not broadcast!");
 		}
 	}
 	else {
 		VideoPlayRet ret;
 		ret.VideoNames = m_lastPlayVideo.c_str();
 		ret.ret = true;
-		Dbg("stop play video notice %s success.", ret.VideoNames.GetData());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop play video notice %s success.", ret.VideoNames.GetData());
 		SpSendBroadcast(GetFunction(), eMsg_VideoPlayRet, eMsgSig_VideoPlayRet, ret);
 	}
 }
@@ -510,7 +510,7 @@ int CLocalMediaPlayEntity::GetAudioOutDevName(char* strDev, size_t uLen)
 		iRet = 0;
 		if (false == m_bgetflag) {
 			m_bgetflag = true;
-			Dbg("%s:%d audio Out Device Name is %s.", __FUNCTION__, __LINE__, strDev);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d audio Out Device Name is %s.", __FUNCTION__, __LINE__, strDev);
 		}
 	}
 
@@ -529,7 +529,7 @@ int CLocalMediaPlayEntity::PlayingAudioDataCallback(audio_param_t* param, const
 		}
 
 		if (8000 == param->freq && 1 == param->channels && 1 == param->fmt) {
-			//Dbg("%s:%d uaudiolen:%d", __FUNCTION__, __LINE__, uaudiolen);
+			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d uaudiolen:%d", __FUNCTION__, __LINE__, uaudiolen);
 			if (uaudiolen + m_leftlen <= RVC_AUDIO_BUFFER_LEN) {
 				int icount = (uaudiolen + m_leftlen) / RVC_AUDIO_LEN;
 				if (icount > 0) {
@@ -546,10 +546,10 @@ int CLocalMediaPlayEntity::PlayingAudioDataCallback(audio_param_t* param, const
 						frm.samplespersec = param->freq;
 						frm.iseriesnumber = m_iseriesnumber++;
 						if (!m_remote_audio_queue->InsertAudio(&frm)) {
-							Dbg("InsertAudio failed! frameCount:%d", frm.framesize);
+							DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("InsertAudio failed! frameCount:%d", frm.framesize);
 						}
 						else {
-							//Dbg("%s:%d InsertAudio(seriesnumber = %d) success", __FUNCTION__, __LINE__, frm.iseriesnumber);
+							//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d InsertAudio(seriesnumber = %d) success", __FUNCTION__, __LINE__, frm.iseriesnumber);
 							if (m_bRecordPCM && m_pFile){
 								fwrite(frm.data, RVC_AUDIO_LEN, 1, m_pFile);
 							}
@@ -604,14 +604,14 @@ int CLocalMediaPlayEntity::GetPlayerIcoPath(char* strPath, size_t uLen)
 	CSimpleStringA csBinPath;
 	ErrorCodeEnum eErrPath = GetFunction()->GetPath("Bin", csBinPath);
 	if (eErrPath != Error_Succeed) {
-		Dbg("GetBasePath failed (%d).", eErrPath);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("GetBasePath failed (%d).", eErrPath);
 		return iRet;
 	}
 
 	CSimpleStringA szIcoName("rvc_media_player_64px.bmp");
 	szIcoName = csBinPath + SPLIT_SLASH_STR + szIcoName;
 	if (m_bgetico == false) {
-		Dbg("media player ico full path is %s.", szIcoName.GetData());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("media player ico full path is %s.", szIcoName.GetData());
 		m_bgetico = true;
 	}
 
@@ -636,7 +636,7 @@ int CLocalMediaPlayEntity::GetAudioOutDev()
 		table.AddEntryString("audio", "handfree_out_dev", m_strAudioOutDev, "$");
 		Error = table.Load(spRootConfig);
 		if (Error == Error_Succeed) {
-			Dbg("Audio Out Device name is %s.", m_strAudioOutDev.GetData());
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Audio Out Device name is %s.", m_strAudioOutDev.GetData());
 			iRet = 0;
 		}
 	}
@@ -650,15 +650,15 @@ void CLocalMediaPlayEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID n
 	const CAutoArray<DWORD> &Param, const char *pszEntityName, const char *pszModuleName, const char *pszMessage, const linkContext& pLinkInfo)
 {
 	if (dwUserCode == LOG_EVT_SELFCHECK_IEBROWSER_IDLE){
-		Dbg("IEBrowser to idle, stop all media!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("IEBrowser to idle, stop all media!");
 		StopAll();
 	}
 	else if(LOG_EVT_UI_STARTREMOTERECORD == dwUserCode){
-		Dbg("Start remote record.");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Start remote record.");
 		HandleRemoteRecord(pszMessage);
 	}
 	else if (LOG_EVT_UI_STOPREMOTERECORD == dwUserCode) {
-		Dbg("Stop remote record.");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop remote record.");
 		m_bStartRecord = false;
 		m_iseriesnumber = 0;
 		if (NULL != m_remote_audio_queue) {
@@ -732,14 +732,14 @@ void CLocalMediaPlayEntity::OnStarted()
 #ifdef RVC_OS_WIN
 	m_scanThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)& qryMedia, this, 0, NULL);
 	if (NULL != m_scanThread)
-		Dbg("create qryMeia thread success, %d.", m_scanThread);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create qryMeia thread success, %d.", m_scanThread);
 #else
 	int err = pthread_create(&m_scanThreadId, NULL, queryMedia, this);
 	if (0 == err) {
-		Dbg("create queryMedia thread success, %u.", m_scanThreadId);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create queryMedia thread success, %u.", m_scanThreadId);
 	}
 	else {
-		Dbg("create queryMedia thread failed.");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create queryMedia thread failed.");
 	}
 
 	GetPcmRecordFlag();
@@ -785,13 +785,13 @@ ErrorCodeEnum CLocalMediaPlayEntity::__OnClose(ErrorCodeEnum preOperationError)
 DWORD WINAPI CheckAudioThread(LPVOID param)
 {
 	CLocalMediaPlayEntity *entity = (CLocalMediaPlayEntity*)param;
-	Dbg("Begin CheckAudioThread");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Begin CheckAudioThread");
 
 
 	HANDLE playThread = NULL;
 	if (!entity->m_pAudioPlayer->checkIsPlay(playThread))
 	{
-		Dbg("Create play audio Media Thread Failed!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Create play audio Media Thread Failed!");
 		return 0;
 	}
 	WaitForSingleObject(playThread, INFINITE);
@@ -800,7 +800,7 @@ DWORD WINAPI CheckAudioThread(LPVOID param)
 	AudioPlayRet ret;
 	ret.AudioNames = entity->m_lastPlayAudio.c_str();
 	ret.ret = true;
-	Dbg("stop play audio %s success", ret.AudioNames);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop play audio %s success", ret.AudioNames);
 	SpSendBroadcast(entity->GetFunction(), eMsg_AudioPlayRet, eMsgSig_AudioPlayRet, ret);
 
 	return 0;
@@ -811,16 +811,16 @@ DWORD WINAPI CheckAudioThread(LPVOID param)
 void* StartAudioPlayingThreadFunc(void* param)
 {
 	CLocalMediaPlayEntity* entity = (CLocalMediaPlayEntity*)param;
-	Dbg("Enter StartAudioPlayingThreadFunc");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Enter StartAudioPlayingThreadFunc");
 	const char* pAudioNames = entity->m_lastPlayAudio.c_str();
-	Dbg("Begin StartAudio, and Audio Info is %s.", pAudioNames);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Begin StartAudio, and Audio Info is %s.", pAudioNames);
 	if (0 == entity->m_pMediaAudioPlayer->PlayLocalAudio(pAudioNames)) {
-		Dbg("Succeed to StartAudio, and Audio Info is %s.", pAudioNames);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to StartAudio, and Audio Info is %s.", pAudioNames);
 	}
 	else{
-		Dbg("StartAudio failed, for %s is not exsit.", pAudioNames);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("StartAudio failed, for %s is not exsit.", pAudioNames);
 	}
-	Dbg("Leave StartAudioPlayingThreadFunc");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Leave StartAudioPlayingThreadFunc");
 	entity->m_uMediaPlayThreadId = 0;
 
 	return 0;
@@ -860,7 +860,7 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
 			{
 				config.nVolume = entity->m_defaultVolum;
 			}
-			Dbg("config.nVolume=%d while play local video.", config.nVolume);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("config.nVolume=%d while play local video.", config.nVolume);
 			// 判断当前时间是否允许播放
 			SYSTEMTIME st;
 			GetLocalTime(&st);
@@ -874,13 +874,13 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
 			entity->m_pVideoPlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config);
 			if (!entity->m_pVideoPlayer[entity->m_mediaParam.nCfgInx]->checkIsPlay(playThread))
 			{
-				Dbg("Create play Video Media Thread Failed!");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Create play Video Media Thread Failed!");
 				return 0;
 			}
 			WaitForSingleObject(playThread, INFINITE);
 			if (entity->m_pVideoPlayer[entity->m_mediaParam.nCfgInx]->checkIsStop())
 			{
-				Dbg("stop play video");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop play video");
 				return 0;
 			}
 			else
@@ -890,7 +890,7 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
 		for (vector<ResourceParse>::iterator i = curParse.begin(); i != curParse.end(); i++)
 		{
 			HANDLE playThread = NULL;
-			Dbg("begin play extend %c:%s, %s", i->type, i->resourcePath.c_str(), i->videoNames.c_str());
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("begin play extend %c:%s, %s", i->type, i->resourcePath.c_str(), i->videoNames.c_str());
 			if ('V' == i->type)
 			{//video
 				CWmpPlayConfig config;
@@ -908,7 +908,7 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
 				{
 					config.nVolume = entity->m_defaultVolum;
 				}
-				Dbg("config.nVolume=%d while play local video.", config.nVolume);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("config.nVolume=%d while play local video.", config.nVolume);
 				config.nWndX = entity->m_mediaParam.nWndX;
 				config.nWndY = entity->m_mediaParam.nWndY;
 				config.nWndWidth = entity->m_mediaParam.nWndWidth;
@@ -931,13 +931,13 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
 				entity->m_pVideoPlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config);
 				if (!entity->m_pVideoPlayer[entity->m_mediaParam.nCfgInx]->checkIsPlay(playThread))
 				{
-					Dbg("Create play Video Media Thread Failed!");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Create play Video Media Thread Failed!");
 					return 0;
 				}
 				WaitForSingleObject(playThread, INFINITE);
 				if (entity->m_pVideoPlayer[entity->m_mediaParam.nCfgInx]->checkIsStop())
 				{//ֹͣ����
-					Dbg("stop play video");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop play video");
 					return 0;
 				}
 				else
@@ -971,14 +971,14 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
 				entity->m_pImagePlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config);
 				if (!entity->m_pImagePlayer[entity->m_mediaParam.nCfgInx]->checkIsPlay(playThread))
 				{
-					Dbg("Create play Image Media Thread Failed!");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Create play Image Media Thread Failed!");
 					return 0;
 				}
 
 				WaitForSingleObject(playThread, i->playInterval);
 				if (entity->m_pImagePlayer[entity->m_mediaParam.nCfgInx]->checkIsStop())
 				{//ֹͣ����
-					Dbg("stop play Image");
+					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop play Image");
 					return 0;
 				}
 				else
@@ -995,7 +995,7 @@ void* StartMediaPlayFunc(void* param)
 	if (NULL == param){
 		return (void*)&iRet;
 	}
-	Dbg("Enter Media Play Function.");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Enter Media Play Function.");
 
 	CLocalMediaPlayEntity* entity = (CLocalMediaPlayEntity*)param;
 	while (entity->GetPlayFlag())
@@ -1040,10 +1040,10 @@ void* StartMediaPlayFunc(void* param)
 
 		for (int i = 0; i < uCount && i < MAX_LOCAL_MEDIAS && entity->GetPlayFlag(); i++)
 		{
-			//Dbg("ResourceList[%d] address is 0x%0x", i, ResourceList[i]);
+			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ResourceList[%d] address is 0x%0x", i, ResourceList[i]);
 			int64_t playThreadId = 0;
 			rvcResourceParse_t item = ResourceList[i];
-			//Dbg("begin play extend %c:%s, %s", item.type, item.strResourcePath, item.strvideoNames);
+			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("begin play extend %c:%s, %s", item.type, item.strResourcePath, item.strvideoNames);
 			if ('V' == item.type)
 			{//video
 				CMediaPlayConfig config = {0};
@@ -1060,7 +1060,7 @@ void* StartMediaPlayFunc(void* param)
 					config.nVolume = entity->m_defaultVolum;
 				}
 				
-				//Dbg("config.nVolume=%d while play local video.", config.nVolume);
+				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("config.nVolume=%d while play local video.", config.nVolume);
 				config.nWndX = entity->m_mediaParam.nWndX;
 				config.nWndY = entity->m_mediaParam.nWndY;
 				config.nWndWidth = entity->m_mediaParam.nWndWidth;
@@ -1081,7 +1081,7 @@ void* StartMediaPlayFunc(void* param)
 			}
 			else if ('P' == item.type)
 			{//play Image
-				Dbg("Begin new Image play, entity->m_mediaParam.nCfgInx = %d.", entity->m_mediaParam.nCfgInx);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Begin new Image play, entity->m_mediaParam.nCfgInx = %d.", entity->m_mediaParam.nCfgInx);
 				CPicPlayConfig config = {0};
 				config.bFullScreen = IS_DEBUG ? false : item.fullScreen;
 				config.bPrimMonitor = IS_DEBUG ? true : item.primMonitor;
@@ -1097,19 +1097,19 @@ void* StartMediaPlayFunc(void* param)
 				if (entity->m_pPicturePlayer[entity->m_mediaParam.nCfgInx]->checkIsStop()){
 					entity->m_pPicturePlayer[entity->m_mediaParam.nCfgInx]->PlayMedia(config);
 					if (!entity->m_pPicturePlayer[entity->m_mediaParam.nCfgInx]->checkIsPlay(&playThreadId)) {
-						Dbg("Create play Image Media Thread Failed!");
+						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Create play Image Media Thread Failed!");
 						iRet = -1;
 						return (void*)& iRet;
 					}
 					else {
-						Dbg("Image Media Player Thread id is %u.", playThreadId);
+						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Image Media Player Thread id is %u.", playThreadId);
 					}
 					if (0 == pthread_join(playThreadId, NULL)) {
-						Dbg("pthread join thread id %u success.", playThreadId);
+						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("pthread join thread id %u success.", playThreadId);
 						iRet = 0;
 					}
 					else {
-						Dbg("pthread join thread id %u failed for %s.", playThreadId, strerror(errno));
+						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("pthread join thread id %u failed for %s.", playThreadId, strerror(errno));
 						iRet = -1;
 					}
 				}
@@ -1117,12 +1117,12 @@ void* StartMediaPlayFunc(void* param)
 			}
 		}
 		unsigned int uend_time = y2k_time_now();
-		//Dbg("uend_time - ustart_time = %u.", uend_time - ustart_time);
+		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("uend_time - ustart_time = %u.", uend_time - ustart_time);
 		if (uend_time - ustart_time < RVC_MIN_LOCALPLAYER_TIME) {
 			Sleep(30*DEFAULT_SLEEP_TIME);
 		}
 	}
-	Dbg("Leave Media Play Function.");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Leave Media Play Function.");
 	entity->m_uMediaPlayThreadId = 0;
 	return (void*)&iRet;
 }
@@ -1133,15 +1133,15 @@ void* StartNoticePlayThreadFunc(void* param)
 {
 	int iRet = -1;
 	CLocalMediaPlayEntity* entity = (CLocalMediaPlayEntity*)param;
-	Dbg("Enter NoticePlayThreadFunc");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Enter NoticePlayThreadFunc");
 	const char* pVideoName = entity->m_lastPlayVideo.c_str();
-	Dbg("Begin Start Notice Play, and Video Notice Info is %s.", pVideoName);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Begin Start Notice Play, and Video Notice Info is %s.", pVideoName);
 	
 	Clibmediaplayer* player = entity->m_pMediaPlayer[entity->m_mediaParam.nCfgInx];
 	player->PlayVideoNotice(entity->m_mediaParam.nWndX, entity->m_mediaParam.nWndY, entity->m_mediaParam.nWndWidth, entity->m_mediaParam.nWndHeight, pVideoName);
 	
-	Dbg("Succeed to Start Notice Play, and Video Notice Info is %s.", pVideoName);
-	Dbg("Leave NoticePlayThreadFunc");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to Start Notice Play, and Video Notice Info is %s.", pVideoName);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Leave NoticePlayThreadFunc");
 	entity->m_uNoticePlayThreadId = 0;
 
 	iRet = 0;
@@ -1154,7 +1154,7 @@ void CLocalMediaPlayEntity::StartVideo(int nCfgInx, int nWndX, int nWndY, int nW
 {
 	if (nCfgInx >= MAX_PLAY_CHANNELS || nCfgInx < 0)
 	{
-		Dbg("Invalid CfgInx while StartVideo!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Invalid CfgInx while StartVideo!");
 		return;
 	}
 	
@@ -1176,10 +1176,10 @@ void CLocalMediaPlayEntity::StartVideo(int nCfgInx, int nWndX, int nWndY, int nW
 	m_badplayflag = true;
 	int err = pthread_create(&m_uMediaPlayThreadId, NULL, StartMediaPlayFunc, this);
 	if (0 == err) {
-		Dbg("create media play thread[%u] success.", m_uMediaPlayThreadId);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create media play thread[%u] success.", m_uMediaPlayThreadId);
 	}
 	else {
-		Dbg("create media play thread failed.");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create media play thread failed.");
 	}
 
 #endif 
@@ -1200,20 +1200,20 @@ void CLocalMediaPlayEntity::StartAudio(const char *pAudioNames)
 		audioPlayThread = NULL;
 	}
 
-	Dbg("Begin StartAudio, and Audio Info is %s.", pAudioNames);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Begin StartAudio, and Audio Info is %s.", pAudioNames);
 	m_pAudioPlayer->PlayLocalAudio(pAudioNames);
-	Dbg("Succeed to StartAudio, and Audio Info is %s.", pAudioNames);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to StartAudio, and Audio Info is %s.", pAudioNames);
 
 	auto audioRet = GetLocalAudioVolume();
 	m_pAudioPlayer->SetVolume(audioRet.second);
-	Dbg("Succeed to set audio volume %d!", audioRet.second);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to set audio volume %d!", audioRet.second);
 
 	m_lastPlayAudio = pAudioNames;
 	audioPlayThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)& CheckAudioThread, this, 0, NULL);
 #else
 
 	if (m_pMediaAudioPlayer->checkIsPlay()) {
-		Dbg("current is playing, close it.");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("current is playing, close it.");
 		if (0 != m_uMediaPlayThreadId){
 			m_pMediaAudioPlayer->Close();
 			m_uMediaPlayThreadId = 0;
@@ -1225,17 +1225,17 @@ void CLocalMediaPlayEntity::StartAudio(const char *pAudioNames)
 
 	int err = pthread_create(&m_uMediaPlayThreadId, NULL, StartAudioPlayingThreadFunc, this);
 	if (0 == err) {
-		Dbg("create audio play thread[%u] success.", m_uMediaPlayThreadId);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create audio play thread[%u] success.", m_uMediaPlayThreadId);
 	}
 	else {
-		Dbg("create audio play thread failed.");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create audio play thread failed.");
 	}
 
 	m_buserstopaudio = false;
 
 	auto audioRet = GetLocalAudioVolume();
 	m_pMediaAudioPlayer->SetVolume(audioRet.second);
-	Dbg("Succeed to set audio volume %d!", audioRet.second);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to set audio volume %d!", audioRet.second);
 	
 #endif // RVC_OS_WIN
 }
@@ -1244,7 +1244,7 @@ void CLocalMediaPlayEntity::StartImage(int nCfgInx, int nWndX, int nWndY, int nW
 {
 	if (nCfgInx >= MAX_PLAY_CHANNELS || nCfgInx < 0)
 	{
-		Dbg("Invalid CfgInx while StartImage!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Invalid CfgInx while StartImage!");
 		return;
 	}
 
@@ -1254,7 +1254,7 @@ void CLocalMediaPlayEntity::StartImage(int nCfgInx, int nWndX, int nWndY, int nW
 	m_pPicturePlayer[nCfgInx]->Play(nCfgInx, nWndX, nWndY, nWndWidth, nWndHeight);
 #endif // RVC_OS_WIN
 
-	Dbg("Succeed to StartImage!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to StartImage!");
 }
 
 
@@ -1262,7 +1262,7 @@ void CLocalMediaPlayEntity::StopVideo(int nCfgInx)
 {
 	if (nCfgInx >= MAX_PLAY_CHANNELS || nCfgInx < 0)
 	{
-		Dbg("Invalid CfgInx while StopVideo!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Invalid CfgInx while StopVideo!");
 		return;
 	}
 
@@ -1281,7 +1281,7 @@ void CLocalMediaPlayEntity::StopVideo(int nCfgInx)
 
 #endif // RVC_OS_WIN
 
-	Dbg("Succeed to StopVideo!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to StopVideo!");
 }
 
 void CLocalMediaPlayEntity::StopAudio()
@@ -1292,14 +1292,14 @@ void CLocalMediaPlayEntity::StopAudio()
 	m_pMediaAudioPlayer->Close();
 	m_buserstopaudio = true;
 #endif
-	Dbg("Succeed to StopAudio!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to StopAudio!");
 }
 
 void CLocalMediaPlayEntity::StopImage(int nCfgInx)
 {
 	if (nCfgInx >= MAX_PLAY_CHANNELS || nCfgInx < 0)
 	{
-		Dbg("Invalid CfgInx while StopImage!");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Invalid CfgInx while StopImage!");
 		return;
 	}
 
@@ -1309,7 +1309,7 @@ void CLocalMediaPlayEntity::StopImage(int nCfgInx)
 	m_pPicturePlayer[nCfgInx]->Close();
 #endif // RVC_OS_WIN
 
-	Dbg("Succeed to StopImage!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Succeed to StopImage!");
 }
 
 void CLocalMediaPlayEntity::StopAll()
@@ -1324,7 +1324,7 @@ void CLocalMediaPlayEntity::StopAll()
 
 bool CLocalMediaPlayEntity::GetLocalVideoVolume(int nCfgInx, int &nVolume)
 {
-	//Dbg("get local video volume req.");
+	//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get local video volume req.");
 	CSmartPointer<IConfigInfo> spConfig;
 	ErrorCodeEnum Error = GetFunction()->OpenConfig(Config_Run, spConfig);
 	if (Error == Error_Succeed)
@@ -1332,18 +1332,18 @@ bool CLocalMediaPlayEntity::GetLocalVideoVolume(int nCfgInx, int &nVolume)
 		Error = spConfig->ReadConfigValueInt("LocalVideo", "Volume", nVolume);
 		if (Error == Error_Succeed && nVolume >= 0 && nVolume <= 100)
 		{
-			//Dbg("succeed to get local video volume with nCfgInx:%d, nVolume:%d", nCfgInx, nVolume);
+			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to get local video volume with nCfgInx:%d, nVolume:%d", nCfgInx, nVolume);
 			return true;
 		}
 	}
 
-	Dbg("fail to get local video volume!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("fail to get local video volume!");
 	return false;
 }
 
 std::pair<bool, int> CLocalMediaPlayEntity::GetLocalAudioVolume()
 {
-	Dbg("get local audio volume req.");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get local audio volume req.");
 	CSmartPointer<IConfigInfo> spConfig;
 	int nVolume = 0;
 	ErrorCodeEnum Error = GetFunction()->OpenConfig(Config_Run, spConfig);
@@ -1354,23 +1354,23 @@ std::pair<bool, int> CLocalMediaPlayEntity::GetLocalAudioVolume()
 		//{
 		//	nVolume = 50;
 		//	spConfig->WriteConfigValueInt("LocalAudio", "Volume", nVolume);
-		//	Dbg("read nVolume 0, set default 50");
+		//	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("read nVolume 0, set default 50");
 		//}
 		if (Error == Error_Succeed && nVolume >= 0 && nVolume <= 100)
 		{
-			Dbg("succeed to get local audio volume with nVolume:%d", nVolume);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to get local audio volume with nVolume:%d", nVolume);
 			return std::make_pair(true, nVolume);
 		}
 	}
 
-	Dbg("fail to get local audio volume!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("fail to get local audio volume!");
 	return std::make_pair(false, nVolume);
 }
 
 
 bool CLocalMediaPlayEntity::SetLocalAudioVolume(int nVolume)
 {
-	Dbg("set local video audio req.");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("set local video audio req.");
 	if (nVolume < 0 || nVolume > 100)
 	{
 		return false;
@@ -1382,7 +1382,7 @@ bool CLocalMediaPlayEntity::SetLocalAudioVolume(int nVolume)
 		Error = spConfig->WriteConfigValueInt("LocalAudio", "Volume", nVolume);
 		if (Error == Error_Succeed)
 		{
-			Dbg("succeed to set local audio volume with nVolume:%d!", nVolume);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to set local audio volume with nVolume:%d!", nVolume);
 #ifdef RVC_OS_WIN
 			m_pAudioPlayer->SetVolume(nVolume);
 #else
@@ -1392,13 +1392,13 @@ bool CLocalMediaPlayEntity::SetLocalAudioVolume(int nVolume)
 		}
 	}
 
-	Dbg("fail to set local video volume!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("fail to set local video volume!");
 	return false;
 }
 
 bool CLocalMediaPlayEntity::SetLocalVideoVolume(int nCfgInx, int nVolume)
 {
-	Dbg("set local video volume req.");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("set local video volume req.");
 	if (nVolume < 0 || nVolume > 100)
 	{
 		return false;
@@ -1410,7 +1410,7 @@ bool CLocalMediaPlayEntity::SetLocalVideoVolume(int nCfgInx, int nVolume)
 		Error = spConfig->WriteConfigValueInt("LocalVideo", "Volume", nVolume);
 		if (Error == Error_Succeed)
 		{
-			Dbg("succeed to set local video volume with nCfgInx:%d, nVolume:%d!", nCfgInx, nVolume);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to set local video volume with nCfgInx:%d, nVolume:%d!", nCfgInx, nVolume);
 			for (int i = 0; i < MAX_PLAY_CHANNELS; ++i)
 			{
 #ifdef RVC_OS_WIN
@@ -1423,7 +1423,7 @@ bool CLocalMediaPlayEntity::SetLocalVideoVolume(int nCfgInx, int nVolume)
 		}
 	}
 
-	Dbg("fail to set local video volume!");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("fail to set local video volume!");
 	return false;
 }
 
@@ -1434,7 +1434,7 @@ bool CLocalMediaPlayEntity::IsRunConfigExist()
 
 	if ((eErr = GetFunction()->GetPath("RunInfo", strPath)) != Error_Succeed)
 	{
-		Dbg("get runinfo path failed(%d)", eErr);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get runinfo path failed(%d)", eErr);
 		return false;
 	}
 
@@ -1480,12 +1480,12 @@ ErrorCodeEnum CLocalMediaPlayEntity::StartNotice(int nCfgInx, int nWndX, int nWn
 	ErrorCodeEnum Error = Error_Succeed;
 	if (eStand2sType == m_eDeviceType || eDesk2SType == m_eDeviceType || eMobilePadType == m_eDeviceType || ePadtype == m_eDeviceType) {
 		if (nCfgInx >= MAX_PLAY_CHANNELS || nCfgInx < 0 || NULL == pVideoName){
-			Dbg("Invalid param CfgInx or video name while StartNotice!");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Invalid param CfgInx or video name while StartNotice!");
 			return Error_Param;
 		}
 
 		if (m_pMediaPlayer[nCfgInx]->checkIsPlay()) {
-			Dbg("current is playing, close it.");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("current is playing, close it.");
 			if (0 != m_uNoticePlayThreadId) {
 				m_pMediaPlayer[nCfgInx]->Close();
 				m_uNoticePlayThreadId = 0;
@@ -1514,13 +1514,13 @@ ErrorCodeEnum CLocalMediaPlayEntity::StartNotice(int nCfgInx, int nWndX, int nWn
 
 			int err = pthread_create(&m_uNoticePlayThreadId, NULL, StartNoticePlayThreadFunc, this);
 			if (0 == err) {
-				Dbg("create notice play thread[%u] success.", m_uNoticePlayThreadId);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create notice play thread[%u] success.", m_uNoticePlayThreadId);
 				char strinfo[MAX_PATH] = { 0 };
 				snprintf(strinfo, MAX_PATH, "start play video notice %s", strNoticeFileName.GetData());
 				LogWarn(Severity_Low, Error_Debug, LOG_EVT_START_NOTICE_PLAY, strinfo);
 			}
 			else {
-				Dbg("create notice play thread failed.");
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create notice play thread failed.");
 			}
 		}
 		else {
@@ -1541,11 +1541,11 @@ ErrorCodeEnum CLocalMediaPlayEntity::StopNotice(int nCfgInx)
 
 	if (eStand2sType == m_eDeviceType || eDesk2SType == m_eDeviceType || eMobilePadType == m_eDeviceType || ePadtype == m_eDeviceType) {
 		if (nCfgInx >= MAX_PLAY_CHANNELS || nCfgInx < 0) {
-			Dbg("Invalid CfgInx while StopNotice!");
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Invalid CfgInx while StopNotice!");
 			return Error_Param;
 		}
 
-		Dbg("m_pPlayer = 0x%08x while play!", m_pMediaPlayer[nCfgInx]);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_pPlayer = 0x%08x while play!", m_pMediaPlayer[nCfgInx]);
 		m_pMediaPlayer[nCfgInx]->Close();
 
 		if (m_uNoticePlayThreadId > 0){
@@ -1617,7 +1617,7 @@ ErrorCodeEnum CLocalMediaPlayEntity::GetPcmRecordFlag()
 		Error = table.Load(spConfig);
 	}
 	
-	Dbg("record pcm flag is %s.", m_bRecordPCM ? "true" : "false");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("record pcm flag is %s.", m_bRecordPCM ? "true" : "false");
 
 	return Error;
 }
@@ -1649,7 +1649,7 @@ ErrorCodeEnum CLocalMediaPlayEntity::HandleRemoteRecord(const char* pszMessage)
 				result[i] = const_cast<LPSTR>(arr2[i].GetData());
 			}
 			if (arr1.GetCount() > 4) {
-				Dbg("record swift number is %s.", result[4]);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("record swift number is %s.", result[4]);
 				snprintf(strSwiftName, MAX_PATH, "%s", result[4]);
 			}
 			delete tmp;
@@ -1667,10 +1667,10 @@ ErrorCodeEnum CLocalMediaPlayEntity::HandleRemoteRecord(const char* pszMessage)
 
 		m_pFile = fopen(strName, "wb+");
 		if (NULL != m_pFile) {
-			Dbg("fopen %s success.", strName);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("fopen %s success.", strName);
 		}
 		else {
-			Dbg("fopen %s failed.", strName);
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("fopen %s failed.", strName);
 		}
 	}
 
@@ -1680,13 +1680,13 @@ ErrorCodeEnum CLocalMediaPlayEntity::HandleRemoteRecord(const char* pszMessage)
 
 void CLocalMediaPlaySession::Handle_StartPlayVideo(SpReqAnsContext<PlayService_StartPlayVideo_Req, PlayService_StartPlayVideo_Ans>::Pointer ctx)
 {
-	Dbg("start play Video, Index:%d, WndX:%d, WndY:%d, WndWidth:%d, WndWidth:%d", ctx->Req.CfgInx, ctx->Req.WndX, ctx->Req.WndY, ctx->Req.WndWidth, ctx->Req.WndHeight);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start play Video, Index:%d, WndX:%d, WndY:%d, WndWidth:%d, WndWidth:%d", ctx->Req.CfgInx, ctx->Req.WndX, ctx->Req.WndY, ctx->Req.WndWidth, ctx->Req.WndHeight);
 	
 	CSimpleStringA UpdateState = "";
 	ErrorCodeEnum Error = m_pEntity->GetFunction()->GetSysVar("UpdateState", UpdateState);
 	if (Error == Error_Succeed && "1" == UpdateState)
 	{
-		Dbg("detect current is upgrade, do not play the media");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("detect current is upgrade, do not play the media");
 		ctx->Answer(Error_Stoped);
 		m_pEntity->StopAll();
 		return;
@@ -1703,7 +1703,7 @@ void CLocalMediaPlaySession::Handle_StartPlayAudio(SpReqAnsContext<PlayService_S
 	ErrorCodeEnum Error = m_pEntity->GetFunction()->GetSysVar("UpdateState", UpdateState);
 	if (Error == Error_Succeed && "1" == UpdateState)
 	{
-		Dbg("detect current is upgrade, do not play the media");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("detect current is upgrade, do not play the media");
 		ctx->Answer(Error_Stoped);
 		m_pEntity->StopAll();
 		return;
@@ -1721,7 +1721,7 @@ void CLocalMediaPlaySession::Handle_StartPlayImage(SpReqAnsContext<PlayService_S
 
 void CLocalMediaPlaySession::Handle_StopPlayVideo(SpReqAnsContext<PlayService_StopPlayVideo_Req, PlayService_StopPlayVideo_Ans>::Pointer ctx)
 {
-	Dbg("stop play Video, Index:%d", ctx->Req.CfgInx);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop play Video, Index:%d", ctx->Req.CfgInx);
 	m_pEntity->StopVideo(ctx->Req.CfgInx);
 	ctx->Answer(Error_Succeed);
 }
@@ -1801,21 +1801,21 @@ void CLocalMediaPlaySession::Handle_StartPlayNotice(SpReqAnsContext<PlayService_
 	CSimpleStringA UpdateState = "";
 	ErrorCodeEnum Error = m_pEntity->GetFunction()->GetSysVar("UpdateState", UpdateState);
 	if (Error == Error_Succeed && "1" == UpdateState) {
-		Dbg("detect current is upgrade, do not play the media");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("detect current is upgrade, do not play the media");
 		ctx->Answer(Error_Stoped);
 		m_pEntity->StopAll();
 		return;
 	}
 
 	CSimpleStringA VideoName = CSimpleStringW2A(ctx->Req.VideoName);
-	Dbg("start play notice, CfgInx = %d, WndX = %d, WndY = %d, WndWidth = %d, WndHeight = %d, and video name is %s.", ctx->Req.CfgInx, ctx->Req.WndX, ctx->Req.WndY, ctx->Req.WndWidth, ctx->Req.WndHeight, VideoName.GetData());
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start play notice, CfgInx = %d, WndX = %d, WndY = %d, WndWidth = %d, WndHeight = %d, and video name is %s.", ctx->Req.CfgInx, ctx->Req.WndX, ctx->Req.WndY, ctx->Req.WndWidth, ctx->Req.WndHeight, VideoName.GetData());
 	Error = m_pEntity->StartNotice(ctx->Req.CfgInx, ctx->Req.WndX, ctx->Req.WndY, ctx->Req.WndWidth, ctx->Req.WndHeight, VideoName.GetData());
 	ctx->Answer(Error);
 }
 
 void CLocalMediaPlaySession::Handle_StopPlayNotice(SpReqAnsContext<PlayService_StopPlayNotice_Req, PlayService_StopPlayNotice_Ans>::Pointer ctx)
 {
-	Dbg("stop play notice, Index:%d", ctx->Req.CfgInx);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop play notice, Index:%d", ctx->Req.CfgInx);
 	ErrorCodeEnum Error = m_pEntity->StopNotice(ctx->Req.CfgInx);
 	ctx->Answer(Error);
 }
@@ -1823,7 +1823,7 @@ void CLocalMediaPlaySession::Handle_StopPlayNotice(SpReqAnsContext<PlayService_S
 
 void CLocalMediaPlaySession::Handle_StopPlayAllMedias(SpReqAnsContext<PlayService_StopPlayAllMedias_Req, PlayService_StopPlayAllMedias_Ans>::Pointer ctx)
 {
-	Dbg("stop play all medias");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop play all medias");
 	ErrorCodeEnum Error = m_pEntity->StopPlayAllMedias();
 	ctx->Answer(Error);
 }