|
@@ -161,7 +161,7 @@ int CPythonExecutor::RedirectSubprocessStdout(LPSTARTUPINFO si /*=NULL*/)
|
|
|
int CPythonExecutor::RunScriptProcess()
|
|
|
{
|
|
|
if (!PathFileExists(m_szScriptPath)) {
|
|
|
- printf("Error:脚本路径无效\n");
|
|
|
+ GLOBAL::WriteTextLog("【Error】脚本路径无效:%s", m_szScriptPath);
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
@@ -198,10 +198,11 @@ int CPythonExecutor::RunScriptProcess()
|
|
|
&m_pi) // Pointer to PROCESS_INFORMATION structure
|
|
|
)
|
|
|
{
|
|
|
- GLOBAL::WriteTextLog("Error:创建子进程失败 (%d)", GetLastError());
|
|
|
+ GLOBAL::WriteTextLog("【Error】创建子进程失败 (%d),", GetLastError());
|
|
|
return -3;
|
|
|
}
|
|
|
|
|
|
+ GLOBAL::WriteTextLog("Python进程ID=%ld", m_pi.dwProcessId);
|
|
|
// 等待进程完成退出.
|
|
|
WaitForSingleObject(m_pi.hProcess, INFINITE);
|
|
|
|
|
@@ -228,7 +229,7 @@ int CPythonExecutor::RunScriptProcess()
|
|
|
int CPythonExecutor::ServiceRunScriptProcess()
|
|
|
{
|
|
|
if (!PathFileExists(m_szScriptPath)) {
|
|
|
- printf("Error:脚本路径无效\n");
|
|
|
+ GLOBAL::WriteTextLog("【Error】脚本路径无效:%s", m_szScriptPath);
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
@@ -343,10 +344,12 @@ int CPythonExecutor::ServiceRunScriptProcess()
|
|
|
if ( !bResult )
|
|
|
return -1;
|
|
|
|
|
|
+ GLOBAL::WriteTextLog("Python进程ID=%ld", m_pi.dwProcessId);
|
|
|
// 等待进程完成退出.
|
|
|
WaitForSingleObject(m_pi.hProcess, INFINITE);
|
|
|
-
|
|
|
+
|
|
|
Sleep(5000);
|
|
|
+ GLOBAL::WriteTextLog("脚本进程结束(%ld)", m_pi.dwProcessId);
|
|
|
// 关闭进程句柄.
|
|
|
CloseHandle(m_pi.hProcess);
|
|
|
CloseHandle(m_pi.hThread);
|