-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
M Execution logging #191
M Execution logging #191
Conversation
With an addition to the README.md to use an example logging configuration to provide some feedback on executions.
Process process; | ||
try { | ||
process = processBuilder.start(); | ||
process.getOutputStream().close(); | ||
} catch(IOException ex) { | ||
ex.printStackTrace(); | ||
// again, should we do something else here?? | ||
resultBuilder.setExitCode(exitValue); | ||
resultBuilder.setExitCode(exitCode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm having a code-read fail -- can the exitCode here ever be not -1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It cannot, the exitCode assignments after the default initialization all occur after this. lmk if you think that merits different behavior here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, then I would very much prefer you just say -1 here, to not make the reader think about what the value might be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pedantically, I used the exitCode here to match the releaseExecutor information propagated to the ExecuteActionStage so that there would not be any discontinuity between what is logged and what is recorded in the resultBuilder, but I see the point.
Use a constant to describe an incomplete exit code as a result of an IOException on process creation.
With an addition to the README.md to use an example logging
configuration to provide some feedback on executions.