LogicDevice.cpp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. // LogicDevice.cpp : 定义 DLL 应用程序的导出函数。
  2. //
  3. #include "StdAfx.h"
  4. #include "objbase.h"
  5. #include "LogicDevice.h"
  6. #include "PacketAnalizer.h"
  7. #include "MessageInfo.h"
  8. #include "common_api.h"
  9. #include "LocalConfig.h"
  10. #include "Base64.h"
  11. #include "SystemLogger.hpp"
  12. //-------------Logic Device SysIF--------------------------
  13. LogicDeviceSysIF::LogicDeviceSysIF(void)
  14. {
  15. }
  16. LogicDeviceSysIF::~LogicDeviceSysIF(void)
  17. {
  18. }
  19. //init
  20. void LogicDeviceSysIF::SetLogicDevice(LogicDevice *p)
  21. {
  22. m_pLogicDev = p;
  23. p->SetSysLogicDevice(this);
  24. };
  25. LogicDevice* LogicDeviceSysIF::GetLogicDevice()
  26. {
  27. return m_pLogicDev;
  28. }
  29. //Command In and Out
  30. //notify from lower layer
  31. RET_STATUS HW_ACTION LogicDeviceSysIF::CmdFromLogicDev(ResDataObject PARAM_IN *pCmd)
  32. {
  33. return RET_FAILED;
  34. };
  35. //notify to lower layer
  36. RET_STATUS SYSTEM_CALL LogicDeviceSysIF::CmdToLogicDev(ResDataObject PARAM_IN *pCmd)
  37. {
  38. if (m_pLogicDev)
  39. {
  40. return m_pLogicDev->CmdToLogicDev(pCmd);
  41. }
  42. return RET_NOSUPPORT;
  43. };
  44. //-------------Data Logic Device--------------------------
  45. LogicDevice::LogicDevice(void)
  46. {
  47. m_pLogger = NULL;
  48. m_pSysLogic = NULL;
  49. m_pDevInstance = new char[40];
  50. m_pResErrorList = new ResDataObject();
  51. GUID guid;
  52. string strDevInstance;
  53. CoCreateGuid(&guid);
  54. guid_2_string(guid, strDevInstance);
  55. sprintf_s(m_pDevInstance,40, "%s", strDevInstance.c_str());
  56. m_EvtNotify = CreateEvent(0, 0, 0, 0);
  57. m_pDrvDPC = NULL;
  58. }
  59. LogicDevice::~LogicDevice(void)
  60. {
  61. delete []m_pDevInstance;
  62. delete m_pResErrorList;
  63. CloseHandle(m_EvtNotify);
  64. m_EvtNotify = NULL;
  65. }
  66. void LogicDevice::NotifyDrvThread()
  67. {
  68. if (m_EvtNotify)
  69. {
  70. SetEvent(m_EvtNotify);
  71. }
  72. }
  73. HANDLE LogicDevice::GetEvtHandle()
  74. {
  75. return m_EvtNotify;
  76. }
  77. //1. init part
  78. void LogicDevice::SetSysLogicDevice(LogicDeviceSysIF *pLogic)
  79. {
  80. m_pSysLogic = pLogic;
  81. }
  82. void LogicDevice::SetLogHandle(Logger PARAM_IN *pLogger)
  83. {
  84. m_pLogger = pLogger;
  85. }
  86. Logger *LogicDevice::GetLogHandle()
  87. {
  88. return m_pLogger;
  89. }
  90. void LogicDevice::SetDrvDPC(DriverDPC *pDPC)
  91. {
  92. m_pDrvDPC = pDPC;
  93. }
  94. DriverDPC *LogicDevice::GetDrvDPC()
  95. {
  96. return m_pDrvDPC;
  97. }
  98. void SYSTEM_CALL LogicDevice::CompleteInit()
  99. {
  100. }
  101. void SYSTEM_CALL LogicDevice::CompleteUnInit()
  102. {
  103. }
  104. int LogicDevice::GetDevice_Thread_Priority()
  105. {
  106. return THREAD_PRIORITY_NONE;
  107. }
  108. RET_STATUS LogicDevice::GetDeviceResource(ResDataObject PARAM_OUT *pDeviceResource)
  109. {
  110. //Get Unit Type (Unit GUID)
  111. if (pDeviceResource->GetFirstOf("LogicDevInstance")<0)
  112. {
  113. pDeviceResource->add("LogicDevInstance", m_pDevInstance);
  114. }
  115. ////
  116. size_t idx = (*pDeviceResource)["Attribute"].size();
  117. if (idx > 0)
  118. {
  119. int erroridx = (*pDeviceResource)["Attribute"].GetFirstOf("ErrorList");
  120. if (erroridx < 0)
  121. {
  122. (*pDeviceResource)["Attribute"].add("ErrorList", *m_pResErrorList);
  123. }
  124. else
  125. {
  126. (*pDeviceResource)["Attribute"]["ErrorList"] = *m_pResErrorList;
  127. }
  128. }
  129. else
  130. {
  131. ResDataObject Attribute;
  132. Attribute.add("ErrorList", *m_pResErrorList);
  133. pDeviceResource->add("Attribute", Attribute);
  134. }
  135. return RET_SUCCEED;
  136. }
  137. //notify from lower layer
  138. RET_STATUS LogicDevice::CmdFromLogicDev(ResDataObject *pCmd)
  139. {
  140. if (pCmd && m_pSysLogic)
  141. {
  142. return m_pSysLogic->CmdFromLogicDev(pCmd);
  143. }
  144. //put log here
  145. return RET_FAILED;
  146. }
  147. std::wstring mb2wc_a(const char* mbstr)
  148. {
  149. std::wstring strVal;
  150. int size = MultiByteToWideChar(CP_UTF8, 0, mbstr, -1, NULL, 0);
  151. wchar_t* wcstr = new wchar_t[size + 1];
  152. if (wcstr)
  153. {
  154. memset(wcstr, 0, size * sizeof(wchar_t));
  155. int ret = MultiByteToWideChar(CP_UTF8, 0, mbstr, -1, wcstr, size);
  156. if (ret != 0) // MultiByteToWideChar returns 0 if it does not succeed.
  157. {
  158. strVal = wcstr;
  159. }
  160. delete[] wcstr;
  161. wcstr = NULL;
  162. }
  163. return strVal;
  164. }
  165. RET_STATUS HW_ACTION LogicDevice::AddErrorMessageUnicode(const char* DevInstance, const char* Code, int &Level, const wchar_t* ResInfo, const wchar_t* Description, int nMessageType)
  166. {
  167. string ResBase64, DesBase64;
  168. wstring wResUTF = ResInfo;
  169. wstring wDesUTF = Description;
  170. CBase64::Encode((const unsigned char *)wResUTF.c_str(), (unsigned long)wResUTF.size() * sizeof(wchar_t), ResBase64);
  171. CBase64::Encode((const unsigned char *)wDesUTF.c_str(), (unsigned long)wDesUTF.size() * sizeof(wchar_t), DesBase64);
  172. return AddErrorMessage(DevInstance, Code, Level, ResBase64.c_str(), DesBase64.c_str(), nMessageType);
  173. }
  174. RET_STATUS HW_ACTION LogicDevice::AddErrorMessage(const char* DevInstance, const char* Code, int &Level, const char* ResInfo, const char* Description, int nMessageType, const char* pAppId)
  175. {
  176. string ResBase64,DesBase64;
  177. wstring wResUTF = mb2wc_a(ResInfo);
  178. wstring wDesUTF = mb2wc_a(Description);
  179. CBase64::Encode((const unsigned char *)wResUTF.c_str(), (unsigned long)wResUTF.size() * sizeof(wchar_t), ResBase64);
  180. CBase64::Encode((const unsigned char *)wDesUTF.c_str(), (unsigned long)wDesUTF.size() * sizeof(wchar_t), DesBase64);
  181. return AddErrorMessageBase(DevInstance, Code, Level, ResBase64.c_str(), DesBase64.c_str(), nMessageType, pAppId);
  182. }
  183. RET_STATUS LogicDevice::AddErrorMessageBase(const char* DevInstance, const char* Code, int &Level, const char* ResInfo, const char* Description, int nMessageType, const char* pAppId)
  184. {
  185. //int ret = 1;
  186. if (Code == 0 || (string)ResInfo == "")
  187. {
  188. TPRINTA_ERROR("Code or ResInfo is empty");
  189. return RET_FAILED;
  190. }
  191. MessageInfo info;
  192. info.CodeID = Code;
  193. info.Type = nMessageType;
  194. info.Level = Level;
  195. info.Resouceinfo = ResInfo;
  196. info.Description = Description;
  197. string strDevInstanceCode = DevInstance;
  198. strDevInstanceCode += Code;
  199. for (size_t i = 0; i < m_pResErrorList->size(); i++)
  200. {
  201. string strInstancekey = m_pResErrorList->GetKey(i);
  202. if (strInstancekey == strDevInstanceCode)
  203. {
  204. //for (size_t j = 0; j < (*m_pResErrorList)[DevInstance].size(); j++)
  205. //{
  206. // string strCodekey = (*m_pResErrorList)[DevInstance].GetKey(j);
  207. // string strtype = (*m_pResErrorList)[DevInstance][strCodekey.c_str()]["Type"];
  208. // if (strCodekey == (string)Code && atoi(strtype.c_str()) == nMessageType)
  209. // {
  210. //ret = 0;
  211. TPRINTA_DEBUG("Same Code:%s with MessageType:%d already Exist", Code,nMessageType);
  212. return RET_SUCCEED;
  213. // }
  214. //}
  215. //ret = 2;
  216. //break;
  217. }
  218. }
  219. //if (ret==1)
  220. {
  221. ResDataObject NotifyData, ResNotify, ErrorInfo/*, tempInfo*/;
  222. //info.GetResDataObject(tempInfo);
  223. //ErrorInfo.update(Code, tempInfo);
  224. info.GetResDataObject(ErrorInfo);
  225. SYSTEMTIME st;
  226. GetLocalTime(&st);
  227. string TimeTag = FormatstdString("%04d-%02d-%02d %02d:%02d:%02d.%03u", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
  228. ErrorInfo.add("CreationTime", TimeTag.c_str());
  229. ErrorInfo.add("AppId", pAppId);
  230. ErrorInfo.add("InstanceId", DevInstance);
  231. if (nMessageType == ERRORTYPE)//只有错误会增加到错误列表中,警告通知上层即可
  232. {
  233. m_pResErrorList->update(strDevInstanceCode.c_str(), ErrorInfo);
  234. }
  235. ResNotify.update(strDevInstanceCode.c_str(), ErrorInfo);
  236. PacketAnalizer::MakeNotify(NotifyData, PACKET_CMD_ADD, "ErrorList", ResNotify);
  237. RES_TPRINTA_DEBUG(NotifyData, "preposterror ErrorType:%u", nMessageType);
  238. CmdFromLogicDev(&NotifyData);
  239. }
  240. //else if (ret == 2)
  241. //{
  242. // ResDataObject NotifyData, ResNotify, ErrorInfo, tempInfo;
  243. // info.GetResDataObject(tempInfo);
  244. // ErrorInfo.update(Code, tempInfo);
  245. // if (nMessageType == ERRORTYPE)//只有错误会增加到错误列表中,警告通知上层即可
  246. // {
  247. // (*m_pResErrorList)[DevInstance].update(Code, tempInfo);
  248. // }
  249. // ResNotify.update(DevInstance, ErrorInfo);
  250. // PacketAnalizer::MakeNotify(NotifyData, PACKET_CMD_ADD, "ErrorList", ResNotify);
  251. // RES_TPRINTA_DEBUG(NotifyData, "preposterror RET:%d,ErrorType:%u", ret, nMessageType);
  252. // CmdFromLogicDev(&NotifyData);
  253. //}
  254. //put log here
  255. return RET_SUCCEED;
  256. }
  257. RET_STATUS LogicDevice::AddErrorMessage(const char* Code, int &Level, const char* ResInfo, int nMessageType, const char* pAppId)
  258. {
  259. AddErrorMessage(m_pDevInstance, Code, Level, ResInfo, "",nMessageType, pAppId);
  260. //put log here
  261. return RET_FAILED;
  262. }
  263. RET_STATUS LogicDevice::DelErrorMessage(const char* DevInstance, const char* Code, int &Level, const char* ResInfo, const char* Description, int nMessageType)
  264. {
  265. int index = -1;
  266. bool m_bClearAll = false;
  267. //trim empty code string
  268. string CodeStr = Code;
  269. if (CodeStr.size() == 0 || CodeStr == "0" || CodeStr == "")
  270. {
  271. CodeStr = " ";
  272. Code = CodeStr.c_str();
  273. m_bClearAll = true;
  274. }
  275. //if ((string)Code == "0" || (string)Code == "")
  276. //{
  277. // m_bClearAll = true;
  278. //}
  279. string strDevInstanceCode = DevInstance;
  280. strDevInstanceCode += Code;
  281. if (m_bClearAll)
  282. {
  283. m_pResErrorList->clear();
  284. }
  285. else
  286. {
  287. MessageInfo info;
  288. info.CodeID = Code;
  289. info.Type = nMessageType;
  290. info.Level = Level;
  291. info.Resouceinfo = ResInfo;
  292. info.Description = Description;
  293. for (size_t i = 0; i < m_pResErrorList->size(); i++)
  294. {
  295. string strInstancekey = m_pResErrorList->GetKey(i);
  296. if (strInstancekey == strDevInstanceCode)
  297. {
  298. //for (size_t j = 0; j < (*m_pResErrorList)[DevInstance].size(); j++)
  299. //{
  300. // string strCodekey = (*m_pResErrorList)[DevInstance].GetKey(j);
  301. // string strtype = (*m_pResErrorList)[DevInstance][strCodekey.c_str()]["Type"];
  302. // if (strCodekey == (string)Code && atoi(strtype.c_str()) == nMessageType)
  303. // {
  304. // index = (INT)j;
  305. // break;
  306. // }
  307. //}
  308. index = (INT)i;
  309. break;
  310. }
  311. }
  312. }
  313. MessageInfo info;
  314. info.CodeID = Code;
  315. info.Type = nMessageType;
  316. info.Level = Level;
  317. info.Resouceinfo = ResInfo;
  318. info.Description = Description;
  319. ResDataObject NotifyData, ResNotify, ErrorInfo/*, tempInfo*/;
  320. //info.GetResDataObject(tempInfo);
  321. //ErrorInfo.add(Code, tempInfo);
  322. info.GetResDataObject(ErrorInfo);
  323. ErrorInfo.add("InstanceId", DevInstance);
  324. bool result = false;
  325. if (index>=0)
  326. {
  327. //result = (*m_pResErrorList)[DevInstance].eraseOneOf(Code, index);
  328. result = (*m_pResErrorList).eraseAllOf(strDevInstanceCode.c_str());
  329. }
  330. if (index >= 0 || m_bClearAll || nMessageType == WARNTYPE)
  331. {
  332. ResNotify.add(strDevInstanceCode.c_str(), ErrorInfo);
  333. PacketAnalizer::MakeNotify(NotifyData, PACKET_CMD_DEL, "ErrorList", ResNotify);
  334. RES_TPRINTA_DEBUG(NotifyData, "pre Del error ErrorCode:%s", Code);
  335. CmdFromLogicDev(&NotifyData);
  336. }
  337. return RET_SUCCEED;
  338. }
  339. RET_STATUS LogicDevice::DelErrorMessage(const char* Code, int &Level, const char* ResInfo, int nMessageType)
  340. {
  341. DelErrorMessage(m_pDevInstance, Code, Level, ResInfo, "", nMessageType);
  342. //put log here
  343. return RET_FAILED;
  344. }
  345. RET_STATUS LogicDevice::EvtProcedure()
  346. {
  347. return RET_FAILED;
  348. }
  349. bool LogicDevice::CheckFeatureLicense(const char *pszFeatureId)
  350. {
  351. TPRINTA_ERROR("NOT FINISHED YET");
  352. return false;
  353. }
  354. RET_STATUS LogicDevice::IoSystemLog(int Level, const char* pCode, const char* pContext, size_t ContextSize, const char* pAppId)
  355. {
  356. std::string strResult = "";
  357. //组Context包
  358. if (m_pLogger)
  359. {
  360. wstring wContect = mb2wc_a(pContext);
  361. CBase64::Encode((const unsigned char*)wContect.c_str(), (unsigned long)wContect.size() * sizeof(wchar_t), strResult);
  362. }
  363. //Thread_Lock();
  364. //if (NULL != fmt)
  365. //{
  366. // va_list marker = NULL;
  367. // va_start(marker, fmt);
  368. // size_t nLength = _vscprintf(fmt, marker) + 1;
  369. // std::vector<char> vBuffer(nLength, '\0');
  370. // int nWritten = vsnprintf_s(&vBuffer[0], vBuffer.size(), nLength, fmt, marker);
  371. // if (nWritten > 0)
  372. // {
  373. // strResult = &vBuffer[0];
  374. // }
  375. // va_end(marker);
  376. //}
  377. //Thread_UnLock();
  378. ResDataObject SysLogNode;
  379. string guidstr;
  380. GUID DeviceGuid;
  381. //组Log包
  382. if (GetDeviceType(DeviceGuid))
  383. {
  384. guid_2_string(DeviceGuid, guidstr);
  385. SysLogNode.add("Module", guidstr.c_str());
  386. SysLogNode.add("AppId", pAppId);
  387. SysLogNode.add("ThreadId", GetCurrentThreadId());
  388. if (pCode)
  389. {
  390. SysLogNode.add("BusinessKey", pCode);
  391. }
  392. else
  393. {
  394. SysLogNode.add("BusinessKey", "");
  395. }
  396. SysLogNode.add("IP", (const char*)getLocalIpAddress());
  397. SYSTEMTIME st;
  398. GetLocalTime(&st);
  399. string TimeTag = FormatstdString("%04d-%02d-%02d %02d:%02d:%02d.%03u", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
  400. SysLogNode.add("CreationTime", TimeTag.c_str());
  401. string strLevel = SysLogLevel2str(Level);
  402. SysLogNode.add("Level", strLevel.c_str());
  403. SysLogNode.add("HostName", (const char*)getLocalMachineId());
  404. SysLogNode.add("ProcessName", (const char*)GetModuleTitle());
  405. SysLogNode.add("FreeText", strResult.c_str());
  406. SysLogNode.add("Context", pCode);
  407. ResDataObject NotifyData;
  408. PacketAnalizer::MakeNotify(NotifyData, PACKET_CMD_MSG, "Syslog", SysLogNode);
  409. CmdFromLogicDev(&NotifyData);
  410. }
  411. else
  412. {
  413. PRINTA_ERROR(m_pLogger, "no Guid??");
  414. return RET_FAILED;
  415. }
  416. //打印LOG
  417. switch (Level)
  418. {
  419. case Syslog_Debug:
  420. RES_PRINTA_DEBUG(m_pLogger, SysLogNode, "SysLog");
  421. break;
  422. case Syslog_Information:
  423. RES_PRINTA_INFO(m_pLogger, SysLogNode, "SysLog");
  424. break;
  425. case Syslog_Warning:
  426. RES_PRINTA_WARN(m_pLogger, SysLogNode, "SysLog");
  427. break;
  428. case Syslog_Error:
  429. RES_PRINTA_ERROR(m_pLogger, SysLogNode, "SysLog");
  430. break;
  431. case Syslog_Fatal:
  432. RES_PRINTA_FATAL(m_pLogger, SysLogNode, "SysLog");
  433. break;
  434. default:
  435. RES_PRINTA_TRACE(m_pLogger, SysLogNode, "SysLog");
  436. break;
  437. }
  438. return RET_SUCCEED;
  439. }
  440. RET_STATUS LogicDevice::SystemLog(SYSLOGLEVEL Level,const char *pCode, const char* fmt, ...)
  441. {
  442. std::string strResult = "";
  443. //组Context包
  444. if (m_pLogger)
  445. {
  446. m_pLogger->Thread_Lock();
  447. if (NULL != fmt)
  448. {
  449. va_list marker = NULL;
  450. va_start(marker, fmt);
  451. size_t nLength = _vscprintf(fmt, marker) + 1;
  452. std::vector<char> vBuffer(nLength, '\0');
  453. int nWritten = vsnprintf_s(&vBuffer[0], vBuffer.size(), nLength, fmt, marker);
  454. if (nWritten > 0)
  455. {
  456. strResult = &vBuffer[0];
  457. }
  458. va_end(marker);
  459. }
  460. m_pLogger->Thread_UnLock();
  461. }
  462. //Thread_Lock();
  463. //if (NULL != fmt)
  464. //{
  465. // va_list marker = NULL;
  466. // va_start(marker, fmt);
  467. // size_t nLength = _vscprintf(fmt, marker) + 1;
  468. // std::vector<char> vBuffer(nLength, '\0');
  469. // int nWritten = vsnprintf_s(&vBuffer[0], vBuffer.size(), nLength, fmt, marker);
  470. // if (nWritten > 0)
  471. // {
  472. // strResult = &vBuffer[0];
  473. // }
  474. // va_end(marker);
  475. //}
  476. //Thread_UnLock();
  477. ResDataObject SysLogNode;
  478. string guidstr;
  479. GUID DeviceGuid;
  480. //组Log包
  481. if (GetDeviceType(DeviceGuid))
  482. {
  483. guid_2_string(DeviceGuid, guidstr);
  484. SysLogNode.add("Module", guidstr.c_str());
  485. SysLogNode.add("AppId", "");
  486. SysLogNode.add("ThreadId", GetCurrentThreadId());
  487. if (pCode)
  488. {
  489. SysLogNode.add("BusinessKey", pCode);
  490. }
  491. else
  492. {
  493. SysLogNode.add("BusinessKey", "");
  494. }
  495. SysLogNode.add("IP", (const char *)getLocalIpAddress());
  496. SYSTEMTIME st;
  497. GetLocalTime(&st);
  498. string TimeTag = FormatstdString("%04d-%02d-%02d %02d:%02d:%02d.%03u", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
  499. SysLogNode.add("CreationTime", TimeTag.c_str());
  500. SysLogNode.add("Level", Level);
  501. SysLogNode.add("HostName", (const char *)getLocalMachineId());
  502. SysLogNode.add("ProcessName", (const char *)GetModuleTitle());
  503. SysLogNode.add("FreeText", strResult.c_str());
  504. ResDataObject NotifyData;
  505. PacketAnalizer::MakeNotify(NotifyData, PACKET_CMD_MSG, "Syslog", SysLogNode);
  506. CmdFromLogicDev(&NotifyData);
  507. }
  508. else
  509. {
  510. PRINTA_ERROR(m_pLogger,"no Guid??");
  511. return RET_FAILED;
  512. }
  513. //打印LOG
  514. switch (Level)
  515. {
  516. case Syslog_Debug:
  517. RES_PRINTA_DEBUG(m_pLogger, SysLogNode, "SysLog");
  518. break;
  519. case Syslog_Information:
  520. RES_PRINTA_INFO(m_pLogger, SysLogNode, "SysLog");
  521. break;
  522. case Syslog_Warning:
  523. RES_PRINTA_WARN(m_pLogger, SysLogNode, "SysLog");
  524. break;
  525. case Syslog_Error:
  526. RES_PRINTA_ERROR(m_pLogger, SysLogNode, "SysLog");
  527. break;
  528. case Syslog_Fatal:
  529. RES_PRINTA_FATAL(m_pLogger, SysLogNode, "SysLog");
  530. break;
  531. default:
  532. RES_PRINTA_TRACE(m_pLogger, SysLogNode, "SysLog");
  533. break;
  534. }
  535. return RET_SUCCEED;
  536. }