Skip to content

Commit 7873fc4

Browse files
committed
fixed:log level and type is incorrect
1 parent a05cc61 commit 7873fc4

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ typedef struct tag_XEngine_ServiceConfig
4242
int nMaxSize; //最大日志大小
4343
int nMaxCount; //最大日志个数
4444
int nLogLeave; //日志等级
45+
int nLogType; //日志类型
4546
}st_XLog;
4647
struct
4748
{

XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
113113
pSt_ServerConfig->st_XTime.nForwardTimeOut = st_JsonXTime["nForwardTimeOut"].asInt();
114114
pSt_ServerConfig->st_XTime.nProxyTimeout = st_JsonXTime["nProxyTimeout"].asInt();
115115

116-
if (st_JsonRoot["XLog"].empty() || (4 != st_JsonRoot["XLog"].size()))
116+
if (st_JsonRoot["XLog"].empty() || (5 != st_JsonRoot["XLog"].size()))
117117
{
118118
Config_IsErrorOccur = true;
119119
Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_XLOG;
@@ -123,6 +123,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
123123
pSt_ServerConfig->st_XLog.nMaxSize = st_JsonXLog["MaxSize"].asInt();
124124
pSt_ServerConfig->st_XLog.nMaxCount = st_JsonXLog["MaxCount"].asInt();
125125
pSt_ServerConfig->st_XLog.nLogLeave = st_JsonXLog["LogLeave"].asInt();
126+
pSt_ServerConfig->st_XLog.nLogType = st_JsonXLog["LogType"].asInt();
126127
_tcsxcpy(pSt_ServerConfig->st_XLog.tszLogFile, st_JsonXLog["tszLogFile"].asCString());
127128

128129
if (st_JsonRoot["XReport"].empty() || (3 != st_JsonRoot["XReport"].size()))

XEngine_Source/XEngine_ServiceApp/XEngine_ServiceApp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ int main(int argc, char** argv)
145145
st_XLogConfig.XLog_MaxBackupFile = st_ServiceConfig.st_XLog.nMaxCount;
146146
st_XLogConfig.XLog_MaxSize = st_ServiceConfig.st_XLog.nMaxSize;
147147
_tcsxcpy(st_XLogConfig.tszFileName, st_ServiceConfig.st_XLog.tszLogFile);
148-
xhLog = HelpComponents_XLog_Init(st_ServiceConfig.st_XLog.nLogLeave, &st_XLogConfig);
148+
xhLog = HelpComponents_XLog_Init(st_ServiceConfig.st_XLog.nLogType, &st_XLogConfig);
149149
if (NULL == xhLog)
150150
{
151151
printf("启动服务中,启动日志失败,错误:%lX", XLog_GetLastError());
152152
goto XENGINE_SERVICEAPP_EXIT;
153153
}
154154
//设置日志打印级别
155-
HelpComponents_XLog_SetLogPriority(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO);
155+
HelpComponents_XLog_SetLogPriority(xhLog, st_ServiceConfig.st_XLog.nLogLeave);
156156
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化日志系统成功"));
157157

158158
signal(SIGINT, ServiceApp_Stop);

0 commit comments

Comments
 (0)