Sfoglia il codice sorgente

!2 reduce some chromium logs

chenliangyu 1 anno fa
parent
commit
9dbc7cfcec

+ 4 - 3
Framework/spbase/sp_tbs_win.cpp

@@ -512,7 +512,8 @@ static void uac_on_connect(sp_tbs_t *tbs, sock_connection *conn, sub_session *se
 {
 	if (!error) {
 		post_session_ack(tbs, conn, session->id, session->tsx_id, error, NULL);
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("sub session created ok! ses_id = %d, tsx_id = %d", session->id, session->tsx_id);
+		if(getReduceSpbaseLog())
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("sub session created ok! ses_id = %d, tsx_id = %d", session->id, session->tsx_id);
 	} else {
 		sp_ses_uac_t *uac = session->uac;
 		post_session_ack(tbs, conn, CONN_INVALID_ID, session->tsx_id, error, get_err_msg(error));
@@ -1113,7 +1114,7 @@ static void process_tcp_pkt(sp_tbs_t *tbs, sock_connection *conn, iobuffer_t **p
 				class_name = (char *)malloc(n);
 				WideCharToMultiByte(CP_ACP, 0, wclass_name, -1, class_name, n, NULL, NULL);
 				FREE(wclass_name);
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv PKT_TYPE_SESSION tsx_id=%d entity_name=%s function_name=%s class_name=%s", tsx_id, entity_name, function_name, class_name);
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("recv PKT_TYPE_SESSION tsx_id=%d entity_name=%s function_name=%s class_name=%s", tsx_id, entity_name, function_name, class_name);
 				on_session(tbs, conn, tsx_id, entity_name, function_name, class_name);
 				if (entity_name)
 					free(entity_name);
@@ -1164,7 +1165,7 @@ static void process_tcp_pkt(sp_tbs_t *tbs, sock_connection *conn, iobuffer_t **p
 				function_name = (char*)malloc(n);
 				WideCharToMultiByte(CP_ACP, 0, wfunction_name, -1, function_name, n, NULL, NULL);
 				FREE(wfunction_name);
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv PKT_TYPE_REGISTER_EVENT register_id=%d, entity_name=%s, function_name=%s", register_id, entity_name, function_name);
+				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("recv PKT_TYPE_REGISTER_EVENT register_id=%d, entity_name=%s, function_name=%s", register_id, entity_name, function_name);
 				on_register_event(tbs, conn, register_id, entity_name, function_name);
 				if (entity_name)
 					free(entity_name);

+ 1 - 1
Module/mod_chromium/CModTools.cpp

@@ -1476,7 +1476,7 @@ namespace Chromium {
 		table.AddEntryString(entityName, "UserMgrAd", strAd, "");
 		table.AddEntryString(entityName, "CacheHead", strCacheHead, "");
 		if (Error_Succeed == table.Load(spCerConfig))
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)(CSimpleString::Format("read centersetting config : UserMgrUrlFulture-%s, UserMgrAd-%s", strFulture.GetData(), strAd.GetData()));
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)(CSimpleString::Format("read centersetting config : UserMgrUrlFulture-%s, UserMgrAd-%s", strFulture.GetData(), strAd.GetData()));
 
 		CChromiumEntity* pChromiumEntity = reinterpret_cast<CChromiumEntity*>(m_pEntity);
 		if (pChromiumEntity != nullptr && pChromiumEntity->HasCustomMainUrl()) {

+ 22 - 1
Module/mod_chromium/baseEx.cpp

@@ -13,7 +13,8 @@
 #include <boost/thread/mutex.hpp>
 #include <boost/thread/lock_guard.hpp>
 #include <boost/algorithm/hex.hpp>
-
+#include "winpr/sysinfo.h"
+#include "winpr/timezone.h"
 #include "EventCode.h"
 #include "exLog/log.h"
 #include "cJSON.h"
@@ -542,6 +543,8 @@ long printSEG()
 #include <boost/stacktrace.hpp>
 #include "CModTools.h"
 #include "CWebsocketServer.h"
+#include <winpr/sysinfo.h>
+#include <winpr/timezone.h>
 
 std::string g_backtracePath = "";
 
@@ -968,6 +971,24 @@ void LogManager::writeLog(const Json::Value& log) {
 }
 
 std::string LogManager::getCurrentTimestamp() {
+	/*
+	FILETIME ft;
+	SYSTEMTIME st;
+	GetSystemTime(&st);
+	SystemTimeToFileTime(&st, &ft);
+
+	FILETIME utc_ft, local_ft;
+#ifdef _WIN32
+	utc_ft.dwLowDateTime = (DWORD)ft.dwLowDateTime;
+	utc_ft.dwHighDateTime = (DWORD)ft.dwHighDateTime;
+	FileTimeToLocalFileTime(&utc_ft, &local_ft);
+	FileTimeToSystemTime(&local_ft, &st);
+#else
+	GetLocalTime(&st);
+#endif // _WIN32
+*/
+
+
 	using namespace std::chrono;
 
 	auto now = system_clock::now();