소스 검색

!2 reduce spbase print event logs and session create messages, since entity chromium is media association and can receive so many event logs

chenliangyu 11 달 전
부모
커밋
affaa1201a
5개의 변경된 파일24개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 0
      Framework/Common/SpBase.h
  2. 12 0
      Framework/spbase/sp_logwithlink.cpp
  3. 4 2
      Framework/spbase/sp_tbs_unix.cpp
  4. 4 2
      Framework/spbase/sp_tbs_win.cpp
  5. 2 0
      Module/mod_chromium/mod_chromium.cpp

+ 2 - 0
Framework/Common/SpBase.h

@@ -1640,6 +1640,8 @@ SPBASE_API void destroy_log_producer_default();
 SPBASE_API void load_debugLevelInCentersetting(const char* fileName);
 SPBASE_API bool refreshLogLevel();
 SPBASE_API int getCurLogLevel();
+SPBASE_API int getReduceSpbaseLog();
+SPBASE_API void setReduceSpbaseLog(int isNor);
 SPBASE_API ErrorCodeEnum GetAllEntityIdx(CAutoArray<CSimpleStringA>& strEntityNames, CAutoArray<WORD>& wEntityDevelopIDs);
 
 

+ 12 - 0
Framework/spbase/sp_logwithlink.cpp

@@ -38,6 +38,7 @@ int g_curEntityIdx = 0;
 std::map<std::string, int> g_entityDebugLevelArr;
 void* g_logProduceSender = NULL;
 int curEntityLogLevel = 1;
+int g_spbaseLogNor = 1;
 std::mutex g_logMtx;
 
 
@@ -828,6 +829,17 @@ SPBASE_API int getCurLogLevel()
     return curEntityLogLevel;
 }
 
+SPBASE_API void setReduceSpbaseLog(int isNor)
+{
+    g_spbaseLogNor = isNor;
+}
+
+SPBASE_API int getReduceSpbaseLog()
+{
+    return g_spbaseLogNor;
+}
+
+
 SPBASE_API bool create_log_producer_default(CSimpleStringA entityName, int idx)
 {
     refreshLogLevel();

+ 4 - 2
Framework/spbase/sp_tbs_unix.cpp

@@ -857,7 +857,8 @@ static void on_session(sp_tbs_t *tbs, sock_connection *conn, int tsx_id, char *e
 
 	rc = create_sub_session(tbs, conn, tsx_id, entity_name, function_name, class_name, &session);
 	if (rc == 0) {
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start create sub session!");
+		if(getReduceSpbaseLog())
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("start create sub session!");
 		//post_session_ack(tbs, conn, session->id, tsx_id, rc, NULL);
 	} else {
 		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("create_sub_session failed! entity: %s, err = %d %s %d",
@@ -906,7 +907,8 @@ static void __bcm_on_message_raw(sp_bcm_listener_t *listener, int from_client_id
 	*msg_pkt = NULL;
 	sp_bcm_listener_inc_ref(listener); //@
 	post_msg(entry->conn->tbs, MSG_ON_EVENT, (param_size_t)entry, (param_size_t)pkt);
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("post event from_client_id:%d", from_client_id);
+	if (getReduceSpbaseLog())
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("post event from_client_id:%d", from_client_id);
 }
 
 static void __bcm_on_destroy(sp_bcm_listener_t *listener, void *user_data)

+ 4 - 2
Framework/spbase/sp_tbs_win.cpp

@@ -721,7 +721,8 @@ static void on_session(sp_tbs_t *tbs, sock_connection *conn, int tsx_id, char *e
 
 	rc = create_sub_session(tbs, conn, tsx_id, entity_name, function_name, class_name, &session);
 	if (rc == 0) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start create sub session!");
+		if (getReduceSpbaseLog())
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start create sub session!");
 		//post_session_ack(tbs, conn, session->id, tsx_id, rc, NULL);
 	} else {
 		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("create_sub_session failed! entity: %s, err = %d %s %d",
@@ -771,7 +772,8 @@ static void __bcm_on_message_raw(sp_bcm_listener_t *listener, int from_client_id
 	*msg_pkt = NULL;
 	sp_bcm_listener_inc_ref(listener); //@
 	post_msg(entry->conn->tbs, MSG_ON_EVENT, (int)entry, (int)pkt);
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("post event from_client_id:%d", from_client_id);
+	if(getReduceSpbaseLog())
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("post event from_client_id:%d", from_client_id);
 }
 
 static void __bcm_on_destroy(sp_bcm_listener_t *listener, void *user_data)

+ 2 - 0
Module/mod_chromium/mod_chromium.cpp

@@ -658,6 +658,8 @@ namespace Chromium {
 
 		ConfigManager::getInstance().m_noStartupPage = (noStartup == 1);
 
+		setReduceSpbaseLog(0);
+
 
 #if defined(RVC_OS_LINUX)
 		// clear all the browser