Skip to content

Commit 472bd64

Browse files
committed
added:set log type support
1 parent 05c389a commit 472bd64

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ typedef struct
4040
int nMaxSize; //最大日志大小
4141
int nMaxCount; //最大日志个数
4242
int nLogLeave; //日志等级
43+
int nLogType; //日志类型
4344
}st_XLog;
4445
struct
4546
{

XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
111111
pSt_ServerConfig->st_XTime.nHTTPTimeOut = st_JsonXTime["nHttpTimeOut"].asInt();
112112
pSt_ServerConfig->st_XTime.nP2PTimeOut = st_JsonXTime["nP2PTimeOut"].asInt();
113113

114-
if (st_JsonRoot["XLog"].empty() || (4 != st_JsonRoot["XLog"].size()))
114+
if (st_JsonRoot["XLog"].empty() || (5 != st_JsonRoot["XLog"].size()))
115115
{
116116
Config_IsErrorOccur = true;
117117
Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_XLOG;
@@ -121,6 +121,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
121121
pSt_ServerConfig->st_XLog.nMaxSize = st_JsonXLog["MaxSize"].asInt();
122122
pSt_ServerConfig->st_XLog.nMaxCount = st_JsonXLog["MaxCount"].asInt();
123123
pSt_ServerConfig->st_XLog.nLogLeave = st_JsonXLog["LogLeave"].asInt();
124+
pSt_ServerConfig->st_XLog.nLogType = st_JsonXLog["LogType"].asInt();
124125
_tcsxcpy(pSt_ServerConfig->st_XLog.tszLogFile, st_JsonXLog["tszLogFile"].asCString());
125126

126127
if (st_JsonRoot["XApi"].empty() || (4 != st_JsonRoot["XApi"].size()))

XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ int main(int argc, char** argv)
184184
goto XENGINE_SERVICEAPP_EXIT;
185185
}
186186
//设置日志打印级别
187-
HelpComponents_XLog_SetLogPriority(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO);
187+
HelpComponents_XLog_SetLogPriority(xhLog, st_ServiceConfig.st_XLog.nLogType);
188188
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化日志系统成功"));
189189

190190
signal(SIGINT, ServiceApp_Stop);

0 commit comments

Comments
 (0)