FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit d0f9150b authored by Dr Adam Thorn's avatar Dr Adam Thorn
Browse files

Separate out logging of stdout and stderr from running wpkg command

parent c7f1423f
No related branches found
No related tags found
No related merge requests found
......@@ -103,12 +103,11 @@ namespace WpkgInstaller
UseShellExecute = false,
};
process.StartInfo = startInfo;
process.EnableRaisingEvents = true;
process.OutputDataReceived += WriteDataToLog;
process.ErrorDataReceived += WriteDataToLog;
process.OutputDataReceived += WriteStdoutToLog;
process.ErrorDataReceived += WriteStderrToLog;
process.Start();
process.BeginErrorReadLine();
......@@ -123,7 +122,7 @@ namespace WpkgInstaller
}
private void WriteDataToLog(object sendingProcess, DataReceivedEventArgs e)
private void WriteStdoutToLog(object sendingProcess, DataReceivedEventArgs e)
{
if (e != null)
{
......@@ -132,6 +131,15 @@ namespace WpkgInstaller
}
private void WriteStderrToLog(object sendingProcess, DataReceivedEventArgs e)
{
if (e != null)
{
eventLog.WriteEntry(e.Data, EventLogEntryType.Error);
}
}
private void eventLog_EntryWritten(object sender, EntryWrittenEventArgs e)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment