Skip to content

Commit b4bcb42

Browse files
committed
added:type print set configure for log
1 parent 3df7b9e commit b4bcb42

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

XEngine_Release/XEngine_Config/XEngine_Config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
"tszLogFile":"./XEngine_XLog/XEngine_Authorize.log",
6565
"MaxSize":1024000,
6666
"MaxCount":10,
67-
"LogLeave":32
67+
"LogLeave":32,
68+
"nLogType":17
6869
},
6970
"XReport":{
7071
"bEnable":true,

XEngine_Source/AuthorizeModule_Configure/Config_Define.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ typedef struct
104104
int nMaxSize; //最大大小
105105
int nMaxCount; //备份个数
106106
int nLogLeave; //日志级别
107+
int nLogType; //日志类型
107108
}st_XLog;
108109
struct
109110
{

XEngine_Source/AuthorizeModule_Configure/ModuleConfigure_Json/ModuleConfigure_Json.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
173173
_tcsxcpy(pSt_ServerConfig->st_XSql.st_MYSQL.tszSQLUser, st_JsonXSql["SQLUser"].asCString());
174174
_tcsxcpy(pSt_ServerConfig->st_XSql.st_MYSQL.tszSQLPass, st_JsonXSql["SQLPass"].asCString());
175175
//日志配置
176-
if (st_JsonRoot["XLog"].empty() || (4 != st_JsonRoot["XLog"].size()))
176+
if (st_JsonRoot["XLog"].empty() || (5 != st_JsonRoot["XLog"].size()))
177177
{
178178
Config_IsErrorOccur = true;
179179
Config_dwErrorCode = ERROR_AUTHORIZE_MODULE_CONFIGURE_XLOG;
@@ -183,6 +183,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
183183
pSt_ServerConfig->st_XLog.nMaxSize = st_JsonXLog["MaxSize"].asInt();
184184
pSt_ServerConfig->st_XLog.nMaxCount = st_JsonXLog["MaxCount"].asInt();
185185
pSt_ServerConfig->st_XLog.nLogLeave = st_JsonXLog["LogLeave"].asInt();
186+
pSt_ServerConfig->st_XLog.nLogType = st_JsonXLog["nLogType"].asInt();
186187
_tcsxcpy(pSt_ServerConfig->st_XLog.tszLogFile, st_JsonXLog["tszLogFile"].asCString());
187188

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

XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/Authorize_Net.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//////////////////////////////////////////////////////////////////////////
33
bool CALLBACK XEngine_Client_TCPAccept(LPCXSTR lpszClientAddr, XSOCKET hSocket, XPVOID lParam)
44
{
5-
65
HelpComponents_Datas_CreateEx(xhTCPPacket, lpszClientAddr, 0);
76
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("TCP客户端:%s,进入服务器"), lpszClientAddr);
87
return true;

XEngine_Source/XEngine_APPService/XEngine_AuthorizeService/XEngine_AuthorizeService.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ int main(int argc, char** argv)
155155
st_XLogConfig.XLog_MaxSize = st_AuthConfig.st_XLog.nMaxSize;
156156
_tcsxcpy(st_XLogConfig.tszFileName, st_AuthConfig.st_XLog.tszLogFile);
157157

158-
xhLog = HelpComponents_XLog_Init(HELPCOMPONENTS_XLOG_OUTTYPE_FILE | HELPCOMPONENTS_XLOG_OUTTYPE_STD, &st_XLogConfig);
158+
xhLog = HelpComponents_XLog_Init(st_AuthConfig.st_XLog.nLogType, &st_XLogConfig);
159159
if (NULL == xhLog)
160160
{
161161
printf("启动服务器失败,启动日志失败,错误:%lX", XLog_GetLastError());

0 commit comments

Comments
 (0)