Skip to content

Commit 262b34b

Browse files
committed
fixed:log print error and log type support
1 parent 6ce03ce commit 262b34b

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ typedef struct tag_XEngine_ServiceConfig
5151
int nMaxSize; //最大日志大小
5252
int nMaxCount; //最大日志个数
5353
int nLogLeave; //日志等级
54+
int nLogType; //输出类型
5455
}st_XLog;
5556
//拉流服务配置,启动越多,服务器性能越差
5657
struct

XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
175175
_tcsxcpy(pSt_ServerConfig->st_XPull.st_PullWebRtc.tszKeyStr, st_PullWebRtc["tszKeyStr"].asCString());
176176
_tcsxcpy(pSt_ServerConfig->st_XPull.st_PullWebRtc.tszDerStr, st_PullWebRtc["tszDerStr"].asCString());
177177
//日志配置
178-
if (st_JsonRoot["XLog"].empty() || (4 != st_JsonRoot["XLog"].size()))
178+
if (st_JsonRoot["XLog"].empty() || (5 != st_JsonRoot["XLog"].size()))
179179
{
180180
Config_IsErrorOccur = true;
181181
Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_XLOG;
@@ -185,6 +185,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
185185
pSt_ServerConfig->st_XLog.nMaxSize = st_JsonXLog["MaxSize"].asInt();
186186
pSt_ServerConfig->st_XLog.nMaxCount = st_JsonXLog["MaxCount"].asInt();
187187
pSt_ServerConfig->st_XLog.nLogLeave = st_JsonXLog["LogLeave"].asInt();
188+
pSt_ServerConfig->st_XLog.nLogType = st_JsonXLog["LogType"].asInt();
188189
_tcsxcpy(pSt_ServerConfig->st_XLog.tszLogFile, st_JsonXLog["LogFile"].asCString());
189190
//信息报告
190191
if (st_JsonRoot["XReport"].empty() || (3 != st_JsonRoot["XReport"].size()))

XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/XEngine_StreamMediaApp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ int main(int argc, char** argv)
223223
goto XENGINE_SERVICEAPP_EXIT;
224224
}
225225
//设置日志打印级别
226-
HelpComponents_XLog_SetLogPriority(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO);
226+
HelpComponents_XLog_SetLogPriority(xhLog, st_ServiceConfig.st_XLog.nLogType);
227227
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化日志系统成功"));
228228

229229
signal(SIGINT, ServiceApp_Stop);

0 commit comments

Comments
 (0)