-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add INFO log about completed external commands #81
Conversation
This should allow timestamps for long-running commands like DB upgrade to be printed/saved before and after the operation for easier measurements
Calculate the ms and include in both the INFO as well as the exception in case there was an error? |
If you're keeping it at |
Pushed |
if r != 0: | ||
raise RunException( | ||
"Non-zero return code", exe, args, r, stdout, stderr) | ||
"Non-zero return code [%s s]" % (end - start), exe, args, r, |
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.
Seems a bit strange to be putting timings in the exception message. How about improve the logging instead: log.error("Non-zero return code %d [%s s]", r, (end - start))
before the raise?
Very minor nitpick: how about format it as |
Done |
raise RunException( | ||
"Non-zero return code", exe, args, r, stdout, stderr) | ||
log.info("Completed [%s s]", end - start) |
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.
Missed one :-( %.3f
Pushed again. |
Thanks |
Add INFO log about completed external commands
This should allow timestamps for long-running commands like DB upgrade to be printed/saved before and after the operation for easier measurements. See ome/omero-documentation#1424 (comment) for instance.