Browse Source

!2 fix chromium init params

chenliangyu 1 month ago
parent
commit
6dde208da7
2 changed files with 12 additions and 16 deletions
  1. 7 9
      Framework/RvcLogSdk/baseFun.cpp
  2. 5 7
      Module/mod_chromium/baseEx.cpp

+ 7 - 9
Framework/RvcLogSdk/baseFun.cpp

@@ -30,10 +30,10 @@ RvcLogSdkManager::RvcLogSdkManager() {
 
 bool RvcLogSdkManager::wait_for_counter_greater_than_one_with_timeout() {
     std::unique_lock<std::mutex> lock(m_mutex);
-    // 等待条件满足(即 counter > 1),最多等待 100 毫秒
+    // 锟饺达拷锟斤拷锟斤拷锟斤拷锟姐(锟斤拷 counter > 1锟斤拷锟斤拷锟斤拷锟饺达拷 100 锟斤拷锟斤拷
     bool timed_out = !condition_variable.wait_for(lock, std::chrono::milliseconds(100), [&] { return m_logFlush_num > 0; });
 
-    m_logFlush_num = 0;//已经刷新了,后续重新计数
+    m_logFlush_num = 0;//锟窖撅拷刷锟斤拷锟剿o拷锟斤拷锟斤拷锟斤拷锟铰硷拷锟斤拷
     return true;
 }
 
@@ -71,23 +71,23 @@ int RvcLogSdkManager::SendTestLog_loki(const char* app, const char* env, const c
 {//http://99.12.23.49:3100/loki/api/v1/push
     if (m_testLogMode == false)
         return -1;
-    // 1. 构造Loki兼容的JSON请求体
+    // 1. 锟斤拷锟斤拷Loki锟斤拷锟捷碉拷JSON锟斤拷锟斤拷锟斤拷
     Json::Value root;
     Json::Value stream;
     Json::Value values(Json::arrayValue);
 
-    // 设置标
+    // 锟斤拷锟矫憋拷
     stream["app"] = app;
     stream["env"] = env;
 
-    // 设置日志内容和时间戳(当前时间戳,纳秒级)
+    // 锟斤拷锟斤拷锟斤拷志锟斤拷锟捷猴拷时锟斤拷锟斤拷锟斤拷锟角笆憋拷锟斤拷锟斤拷锟斤拷锟诫级锟斤拷
     Json::Value logEntry(Json::arrayValue);
     logEntry.append(std::to_string(std::chrono::duration_cast<std::chrono::nanoseconds>(
         std::chrono::system_clock::now().time_since_epoch()).count()));
     logEntry.append(body);
     values.append(logEntry);
 
-    // 组装完整请求
+    // 锟斤拷装锟斤拷锟斤拷锟斤拷锟斤拷
     Json::Value streams(Json::arrayValue);
     Json::Value streamObj;
     streamObj["stream"] = stream;
@@ -110,14 +110,12 @@ int RvcLogSdkManager::SendTestLog_loki(const char* app, const char* env, const c
         client.Do(&sendErr, &curResult, NULL);//Test Logs
     };
 
-    std::thread(send_loki, jsonReq).detach();//必须得用线程,猜测为外部变量析构或这
+    std::thread(send_loki, jsonReq).detach();//锟斤拷锟斤拷锟斤拷锟斤拷叱蹋锟斤拷虏锟轿�拷獠匡拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟�
 
     
     return 0;
 }
 
-
-
 #ifndef _WIN32
 
 

+ 5 - 7
Module/mod_chromium/baseEx.cpp

@@ -891,13 +891,11 @@ ConfigManager::ConfigManager()
 	, m_withDebugMode(false), m_withMagic(false), m_withNoFileLog(false), m_installMode(false), m_withMedia(false), m_withSpecialTest(false), m_withConsole(false),
 	m_withLinkLog(false), m_withUnsafeAd(false), m_withUnsafeMain(false), m_noStartupPage(false),  m_extension_debugOpen(false), m_extension_withTerminal(false)
 {
-	void* logProducer = nullptr;
-	std::map<std::string, void*> g_logProducerArr;
-	bool g_useMagic = false;
-	bool g_loggerInitSuccess = false;
-	bool g_withSpecialTest = false;
-	bool g_hasInitCfg = false;//can discard
-	int g_sogouForce = 0;
+	logProducer = nullptr;
+	g_useMagic = false;
+	g_loggerInitSuccess = false;
+	g_hasInitCfg = false;//can discard
+	g_sogouForce = 0;
 	m_extensionPath = "";
 
 }