Skip to content

Commit

Permalink
Commands: add logging to validation and allow regex matching
Browse files Browse the repository at this point in the history
  • Loading branch information
dasgarner committed Jun 13, 2023
1 parent b00d38d commit 96f5073
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Action/Command.cs
Expand Up @@ -133,6 +133,7 @@ public bool Run()

process.StartInfo = startInfo;
process.Start();
process.Exited += Process_Exited;

string line = "";
while (!process.StandardOutput.EndOfStream)
Expand All @@ -145,6 +146,15 @@ public bool Run()
}
}

private void Process_Exited(object sender, EventArgs e)
{
int exitCode = ((Process)sender).ExitCode;
if (exitCode != 0)
{
LogMessage.Audit("Command", "Run", "Non-zero exit code [" + exitCode + "] returned for command " + Code);
}
}

/// <summary>
/// Get a command from Application Settings based on its Command Code
/// </summary>
Expand Down

0 comments on commit 96f5073

Please sign in to comment.