浏览代码

Z991239-2234 #comment fea 额外存储的db

陈良瑜80374463 3 年之前
父节点
当前提交
0de3cd699b
共有 3 个文件被更改,包括 16 次插入1 次删除
  1. 13 0
      Module/mod_chromium/baseEx.cpp
  2. 2 0
      Module/mod_chromium/baseEx.h
  3. 1 1
      Other/libpublicFun/exLog/log.h

+ 13 - 0
Module/mod_chromium/baseEx.cpp

@@ -9,6 +9,7 @@
 #include <boost/chrono.hpp>
 #include <boost/interprocess/ipc/message_queue.hpp>
 #include <boost/interprocess/permissions.hpp>
+#include "exLog/log.h"
 using namespace boost::interprocess;
 
 #if (defined _WIN32 || defined _WIN64)
@@ -17,6 +18,7 @@ using namespace boost::interprocess;
 
 void* logProducer = nullptr;
 bool g_useMagic = false;
+bool g_loggerInitSuccess = false;
 
 #define NOR_LEN 50
 #define MAX_LOG_LEN 4096
@@ -60,6 +62,17 @@ struct cefclientLog {
 #define CEF_GUID "{5ED197CD-9D64-4D10-9839-2A0773B6F5D2}"
 
 
+bool InitFileLogger(std::string dbgPath)
+{
+	return g_loggerInitSuccess = logger::init(dbgPath.c_str(), "cefLog");
+}
+
+void DbgToFileLogger(std::string msg)
+{
+	if(g_loggerInitSuccess)
+		logger::showLog(msg);
+}
+
 void DbgEx(const char* str, ...)
 {
 	va_list arg;

+ 2 - 0
Module/mod_chromium/baseEx.h

@@ -11,6 +11,8 @@ std::vector<std::string> find_files(const std::string srcPath, const std::string
 std::string generateTimeStr(bool isSimple = false);
 DWORD SaveCefclientLog(std::string magicStr);
 bool SYSTEM_ON(std::string cmdLine, bool isWait = true);
+bool InitFileLogger(std::string dbgPath);
+void DbgToFileLogger(std::string msg);
 
 
 #if (defined _WIN32 || defined _WIN64)

+ 1 - 1
Other/libpublicFun/exLog/log.h

@@ -4,7 +4,7 @@
 // #define USING_ASYNC_LOG_MODE // using sync log sink for debug reason
 
 #include <string>
-#include "..\publicExport.h"
+#include "../publicExport.h"
 
 
  class PUBLIC_API logger {