The script_end() method currently emits a hard-coded "Exit 0" line to the log:
|
def script_end(self): |
|
"""Log end of script""" |
|
self.log.info(self.asterisk) |
|
self.log.info("Exit 0") |
Adding a parameter to this function will allow the user to pass an exit code for the function to log in place of the default:
def script_end(self, exit_code=0):
"""Log end of script"""
self.log.info(self.asterisk)
self.log.info(f"Exit {exit_code}")
This is helpful if the user is calling sys.exit() to pass non-0 exit codes and wishes to record an accurate exit code in the log.
The script_end() method currently emits a hard-coded "Exit 0" line to the log:
redata-commons/redata/commons/logger.py
Lines 183 to 186 in 40acd5c
Adding a parameter to this function will allow the user to pass an exit code for the function to log in place of the default:
This is helpful if the user is calling sys.exit() to pass non-0 exit codes and wishes to record an accurate exit code in the log.