Log.debug production stackprinter messages
This commit is contained in:
parent
051d8cf0ef
commit
b423ab0624
@ -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
|
||||
|
||||
@ -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(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user