How would one capture ALL Python failures and log them into a file? Not just failures captured in a try: / except: code within the program but ALL failures. So if there was a line in the code that does not fail until that code block is reached during execution, it could be logged to a file. Existing try: / except: code in the program should continue to operate but in this case, one would wish to capture errors where one did not expect a failure to ever occur. This would be like the entire program being in a try: while try: that was written into the code would still work.
This could be used in a case where production-level code wants to run without a command console being open while being able to look at a log file to see what may have caused the program to fail.