Skip to content

Commit 9ed8bda

Browse files
committed
improved:set log level though start command
1 parent 03e6315 commit 9ed8bda

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

XEngine_Source/XEngine_ServiceApp/XEngine_CenterApp/XEngine_Configure.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ bool XEngine_Configure_Parament(int argc, char** argv, XENGINE_SERVICECONFIG* pS
3535
{
3636
bIsTest = true;
3737
}
38+
else if (0 == _tcsxcmp("-l", argv[i]))
39+
{
40+
LPCXSTR lpszLogLevel = argv[++i];
41+
if (0 == _tcsxcmp("debug", lpszLogLevel))
42+
{
43+
pSt_Configure->st_XLog.nLogLeave = XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_DEBUG;
44+
}
45+
else if (0 == _tcsxcmp("info", lpszLogLevel))
46+
{
47+
pSt_Configure->st_XLog.nLogLeave = XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO;
48+
}
49+
}
3850
}
3951

4052
return true;

XEngine_Source/XEngine_ServiceApp/XEngine_HTTP2App/XEngine_Configure.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ bool XEngine_Configure_Parament(int argc, char** argv, XENGINE_SERVICECONFIG* pS
3535
{
3636
bIsTest = true;
3737
}
38+
else if (0 == _tcsxcmp("-l", argv[i]))
39+
{
40+
LPCXSTR lpszLogLevel = argv[++i];
41+
if (0 == _tcsxcmp("debug", lpszLogLevel))
42+
{
43+
pSt_Configure->st_XLog.nLogLeave = XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_DEBUG;
44+
}
45+
else if (0 == _tcsxcmp("info", lpszLogLevel))
46+
{
47+
pSt_Configure->st_XLog.nLogLeave = XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO;
48+
}
49+
}
3850
}
3951

4052
return true;

XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Configure.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ bool XEngine_Configure_Parament(int argc, char** argv, XENGINE_SERVICECONFIG* pS
3535
{
3636
bIsTest = true;
3737
}
38+
else if (0 == _tcsxcmp("-l", argv[i]))
39+
{
40+
LPCXSTR lpszLogLevel = argv[++i];
41+
if (0 == _tcsxcmp("debug", lpszLogLevel))
42+
{
43+
pSt_Configure->st_XLog.nLogLeave = XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_DEBUG;
44+
}
45+
else if (0 == _tcsxcmp("info", lpszLogLevel))
46+
{
47+
pSt_Configure->st_XLog.nLogLeave = XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO;
48+
}
49+
}
3850
}
3951

4052
return true;

XEngine_Source/XEngine_ServiceApp/XEngine_WebSocketApp/XEngine_Configure.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ bool XEngine_Configure_Parament(int argc, char** argv, XENGINE_SERVICECONFIG* pS
3535
{
3636
bIsTest = true;
3737
}
38+
else if (0 == _tcsxcmp("-l", argv[i]))
39+
{
40+
LPCXSTR lpszLogLevel = argv[++i];
41+
if (0 == _tcsxcmp("debug", lpszLogLevel))
42+
{
43+
pSt_Configure->st_XLog.nLogLeave = XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_DEBUG;
44+
}
45+
else if (0 == _tcsxcmp("info", lpszLogLevel))
46+
{
47+
pSt_Configure->st_XLog.nLogLeave = XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO;
48+
}
49+
}
3850
}
3951

4052
return true;

0 commit comments

Comments
 (0)