Răsfoiți Sursa

Z991239-5168 #comment 增加卡机硬件适配器埋点日志

Signed-Off-By: commit-hook
刘文涛80174520 1 an în urmă
părinte
comite
85c86a29f5

+ 11 - 6
Module/mod_CardIssuerStand/CardIssuerFSM.cpp

@@ -1196,10 +1196,11 @@ ErrorCodeEnum CCardIssuerFSM::OnExit()
 		l_beginTime = GetTickCountRVC();
 		eExit = m_hDevHelper->GetDevStatus(m_devStatus);
 		l_endTime = GetTickCountRVC();
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::GetDevStatus").setCostTime(l_endTime - l_beginTime)("OnExit::GetDevStatus, m_devStatus.eMedia:%d, m_issueStatus:%d", m_devStatus.eMedia, m_issueStatus);
+		
 
 		if (eExit == Error_Succeed)
 		{
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::GetDevStatus").setCostTime(l_endTime - l_beginTime)("OnExit::GetDevStatus, m_devStatus.eMedia:%d, m_issueStatus:%d", m_devStatus.eMedia, m_issueStatus);
 			if (m_devStatus.eMedia == CI_MEDIA_PRESENT){
 				if (m_issueStatus)
 				{
@@ -1215,15 +1216,19 @@ ErrorCodeEnum CCardIssuerFSM::OnExit()
 				}
 			}
 		}
+		else {
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI("DevAdapter::GetDevStatus").setCostTime(l_endTime - l_beginTime).setResultCode("RTA2322")("OnExit::GetDevStatus err=%s", SpStrError(eExit));
+		}
 		l_beginTime = GetTickCountRVC();
 		eExit = m_hDevHelper->DevClose();
 		l_endTime = GetTickCountRVC();
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::DevClose").setCostTime(l_endTime - l_beginTime)("OnExit::DevClose");
 		
-		if (eExit == Error_Succeed)
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("OnExit,读卡器关闭DevClose成功");
-		else
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("OnExit,读卡器关闭DevClose失败 eErr:%d", eExit);
+		if (eExit == Error_Succeed) {
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::DevClose").setCostTime(l_endTime - l_beginTime)("OnExit,读卡器关闭DevClose成功");
+		}
+		else {
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI("DevAdapter::DevClose").setCostTime(l_endTime - l_beginTime).setResultCode("RTA23CJ")("OnExit,读卡器关闭DevClose失败 eErr:%d", eExit);
+		}
 	}
 	FSMImpl<CCardIssuerFSM>::OnExit();
 	return Error_Succeed;

+ 6 - 1
Module/mod_CardIssuerStand/CardIssuerFSM.h

@@ -13,7 +13,12 @@
 #include "CardAssist.h"
 #include "ICDataElement.h"
 #include "IHttpFunc.h"
+//#include "publicFunExport.h"
+#ifdef RVC_OS_WIN
+#include "json.h"
+#else
 #include "json/json.h"
+#endif //RVC_OS_WIN
 #define REFLECTION(var) #var
 using namespace CardIssuer;
 //using namespace GUIConsole;
@@ -397,7 +402,7 @@ typedef struct CQueryCardTypeReq : CHTTPReq {
 		Json::FastWriter writer;
 		string ret = writer.write(allElm);
 
-		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("CAccessAuthGetTokenReq")("req=%s at CAccessAuthGetTokenReq", ret.c_str());
+
 		return ret;
 	}
 } CQueryCardTypeReq;

+ 19 - 19
Module/mod_CardIssuerStand/mod_cardissuer.cpp

@@ -14,14 +14,14 @@ void CardIssuerServerSession::Handle_Insert(SpReqAnsContext<CardIssuerService_In
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("Insert")("Insert");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Insert");
 	m_pEntity->Insert(ctx);
 }
 void CardIssuerServerSession::Handle_Read(SpReqAnsContext<CardIssuerService_Read_Req, CardIssuerService_Read_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("Read")("Read");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Read");
 	m_pEntity->Read(ctx);
 }
 
@@ -29,7 +29,7 @@ void CardIssuerServerSession::Handle_Capture(SpReqAnsContext<CardIssuerService_C
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("Capture")("Capture");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Capture");
 	m_pEntity->Capture(ctx);
 }
 
@@ -37,7 +37,7 @@ void CardIssuerServerSession::Handle_Eject(SpReqAnsContext<CardIssuerService_Eje
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("Eject")("Eject");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Eject");
 	m_pEntity->Eject(ctx);
 }
 
@@ -45,104 +45,104 @@ void CardIssuerServerSession::Handle_CancelInsert(SpOnewayCallContext<CardIssuer
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("CancelInsert")("CancelInsert");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("CancelInsert");
 	m_pEntity->CancelInsert(ctx);
 }
 void CardIssuerServerSession::Handle_InsertWaitMore(SpOnewayCallContext<CardIssuerService_InsertWaitMore_Info>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("InsertWaitMore")("InsertWaitMore");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("InsertWaitMore");
 	m_pEntity->InsertWaitMore(ctx);
 }
 void CardIssuerServerSession::Handle_PreOnline(SpReqAnsContext<CardIssuerService_PreOnline_Req, CardIssuerService_PreOnline_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("PreOnline")("PreOnline");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("PreOnline");
 	m_pEntity->PreOnline(ctx);
 }
 void CardIssuerServerSession::Handle_PostOnline(SpReqAnsContext<CardIssuerService_PostOnline_Req, CardIssuerService_PostOnline_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("PostOnline")("PostOnline");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("PostOnline");
 	m_pEntity->PostOnline(ctx);
 }
 void CardIssuerServerSession::Handle_Exit(SpOnewayCallContext<CardIssuerService_Exit_Info>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("Exit")("Exit");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Exit");
 	m_pEntity->Exit(ctx);
 }
  void CardIssuerServerSession::Handle_SetIssueFlag(SpOnewayCallContext<CardIssuerService_SetIssueFlag_Info>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("SetIssueFlag")("SetIssueFlag");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SetIssueFlag");
 	m_pEntity->SetIssueFlag(ctx);
 }
 void CardIssuerServerSession::Handle_QueryCardInfo(SpReqAnsContext<CardIssuerService_QueryCardInfo_Req, CardIssuerService_QueryCardInfo_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("QueryCardInfo")("QueryCardInfo");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("QueryCardInfo");
 	m_pEntity->QueryCardInfo(ctx);
 }
 void CardIssuerServerSession::Handle_WriteTrack(SpReqAnsContext<CardIssuerService_WriteTrack_Req, CardIssuerService_WriteTrack_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("WriteTrack")("WriteTrack");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("WriteTrack");
 	m_pEntity->WriteTrack(ctx);
 }
 void CardIssuerServerSession::Handle_GetMaterialCountEx(SpReqAnsContext<CardIssuerService_GetMaterialCountEx_Req, CardIssuerService_GetMaterialCountEx_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("GetMaterialCountEx")("GetMaterialCountEx");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("GetMaterialCountEx");
 	m_pEntity->GetMaterialCountEx(ctx);
 }
 void CardIssuerServerSession::Handle_SetMaterialCountEx(SpReqAnsContext<CardIssuerService_SetMaterialCountEx_Req, CardIssuerService_SetMaterialCountEx_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("SetMaterialCountEx")("SetMaterialCountEx");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SetMaterialCountEx");
 	m_pEntity->SetMaterialCountEx(ctx);
 }
 void CardIssuerServerSession::Handle_SetSomeFlag(SpReqAnsContext<CardIssuerService_SetSomeFlag_Req, CardIssuerService_SetSomeFlag_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("SetSomeFlag")("SetSomeFlag");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SetSomeFlag");
 	m_pEntity->SetSomeFlag(ctx);
 }
 void CardIssuerServerSession::Handle_IssueEx(SpReqAnsContext<CardIssuerService_IssueEx_Req, CardIssuerService_IssueEx_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("IssueEx")("IssueEx");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("IssueEx");
 	m_pEntity->IssueEx(ctx);
 }
 void CardIssuerServerSession::Handle_SAMICCommand(SpReqAnsContext<CardIssuerService_SAMICCommand_Req, CardIssuerService_SAMICCommand_Ans>::Pointer ctx)
 {
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("SAMICCommand")("SAMICCommand");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SAMICCommand");
 	m_pEntity->SAMICCommand(ctx);
 }
 void CardIssuerServerSession::Handle_QueryCIStatus(SpReqAnsContext<CardIssuerService_QueryCIStatus_Req, CardIssuerService_QueryCIStatus_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("QueryCIStatus")("QueryCIStatus");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("QueryCIStatus");
 	m_pEntity->QueryCIStatus(ctx);
 }
 void CardIssuerServerSession::Handle_GetDevInfo(SpReqAnsContext<CardIssuerService_GetDevInfo_Req, CardIssuerService_GetDevInfo_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("GetDevInfo")("GetDevInfo");
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("GetDevInfo");
 	m_pEntity->GetDevInfo(ctx);
 }
 void CCardIssuerEntity::OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName)