Browse Source

modify sys log flag

zhengwei 8 years ago
parent
commit
ea5adcbede
6 changed files with 18 additions and 7 deletions
  1. 2 1
      LogSetting.cpp
  2. 1 1
      LogSetting.h
  3. 4 0
      ProcessRemodule.cpp
  4. 4 3
      YAServer.cpp
  5. 3 1
      YAServerDlg.cpp
  6. 4 1
      YAServerDlg.h

+ 2 - 1
LogSetting.cpp

@@ -6,6 +6,7 @@
 #include "LogSetting.h"
 #include "afxdialogex.h"
 
+extern BOOL m_log_sys_status;
 
 // CLogSetting ¶Ô»°¿ò
 
@@ -13,7 +14,7 @@ IMPLEMENT_DYNAMIC(CLogSetting, CDialogEx)
 
 CLogSetting::CLogSetting(CWnd* pParent /*=NULL*/)
 	: CDialogEx(CLogSetting::IDD, pParent)
-	, m_log_sys_status(FALSE)
+	//, m_log_sys_status(FALSE)
 	, m_log_raw_data(FALSE)
 	, m_log_parse_data(FALSE)
 	, m_log_send_package(FALSE)

+ 1 - 1
LogSetting.h

@@ -19,7 +19,7 @@ protected:
 
 	DECLARE_MESSAGE_MAP()
 public:
-	BOOL m_log_sys_status;
+	//BOOL m_log_sys_status;
 	BOOL m_log_raw_data;
 	BOOL m_log_parse_data;
 	BOOL m_log_send_package;

+ 4 - 0
ProcessRemodule.cpp

@@ -354,6 +354,10 @@ int service_task_init()
 int send_sys_log_message(char* pchr)
 {
     //send thread message
+    if(!m_log_sys_status)
+    {
+        return 0;
+    }
 	unsigned thread_id = rand() % SYS_LOG_PROCESS_THREAD_NUM;
 	if(!PostThreadMessage(nSysLogThreadID[thread_id], SYS_LOG_MSG, (WPARAM)pchr, 0))//post thread msg
     {

+ 4 - 3
YAServer.cpp

@@ -49,8 +49,6 @@ BOOL CYAServerApp::InitInstance()
 	// 如果一个运行在 Windows XP 上的应用程序清单指定要
 	// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
 	//则需要 InitCommonControlsEx()。否则,将无法创建窗口。
-    service_task_init();
-	debug_print_syslog(0, "Service thread, SQL thread, log thread Started.");
 	CreateMutex(NULL, FALSE, _T("MyMux"));
 	if(GetLastError() == ERROR_ALREADY_EXISTS){
 		HWND hWnd = ::FindWindow(NULL, _T("永安信通数据采集系统"));
@@ -97,7 +95,10 @@ BOOL CYAServerApp::InitInstance()
 
 	init_param();
 	load_conf();
-
+	
+    service_task_init();
+	debug_print_syslog(0, "Service thread, SQL thread, log thread Started.");
+	
 	CYAServerDlg dlg;
 	m_pMainWnd = &dlg;
 

+ 3 - 1
YAServerDlg.cpp

@@ -41,6 +41,8 @@
 
 #define STR_LEN_TIME 30
 
+BOOL m_log_sys_status = false;
+
 #ifdef _DEBUG
 #ifndef DEBUG_NEW
 #define new DEBUG_NEW
@@ -6771,7 +6773,7 @@ void CYAServerDlg::OnMenuLog()
 	CLogSetting dlg;
 	dlg.DoModal();
 
-	m_log_sys_status = dlg.m_log_sys_status;
+	//m_log_sys_status = dlg.m_log_sys_status;
 	m_log_raw_data   = dlg.m_log_raw_data;
 	m_log_parse_data = dlg.m_log_parse_data;
 	m_log_recv_package = dlg.m_log_recv_package;

+ 4 - 1
YAServerDlg.h

@@ -21,10 +21,13 @@
 
 #include <json/json.h>
 
+extern BOOL m_log_sys_status;
+
 using namespace sio;
 using namespace std;
 using namespace HostServer;
 
+
 struct  _SLS // system_limit_setting
 {
 	unsigned int over_count_person;
@@ -172,7 +175,7 @@ public:
 	int m_nFilterType;
 	int m_nMallocTimes;
 
-	BOOL m_log_sys_status;
+	//BOOL m_log_sys_status;
 	BOOL m_log_raw_data;
 	BOOL m_log_parse_data;
 	BOOL m_log_send_package;