Log.debug production stackprinter messages

This commit is contained in:
Keith Edmunds 2024-07-26 18:10:53 +01:00
parent 051d8cf0ef
commit b423ab0624
2 changed files with 7 additions and 2 deletions

View File

@ -67,8 +67,12 @@ def log_uncaught_exceptions(type_, value, traceback):
if os.environ["MM_ENV"] == "PRODUCTION":
msg = stackprinter.format(value)
send_mail(
Config.ERRORS_TO, Config.ERRORS_FROM, "Exception from musicmuster", msg
Config.ERRORS_TO,
Config.ERRORS_FROM,
"Exception (log_uncaught_exceptions) from musicmuster",
msg,
)
log.debug(msg)
sys.excepthook = log_uncaught_exceptions

View File

@ -1915,9 +1915,10 @@ if __name__ == "__main__":
send_mail(
",".join(Config.ERRORS_TO),
",".join(Config.ERRORS_FROM),
"Exception from musicmuster",
"Exception from musicmuster.py",
msg,
)
log.debug(msg)
else:
print("\033[1;31;47mUnhandled exception starts")
print(