Protect exceptions when logging
If there is an exception writing a log line, don't break the process. Instead, log the traceback, but allow the program to continue after that point.
This comes from an issue found with the issue creation when is not possible to prepare an uprev candidate. The logging of a info message went wrong, and the exception breaks the program execution. It must recover from this situation, at most log it, and continue with the duties.