-
-
Save kozikow/0de42c1569419e096084644d7ad98cd5 to your computer and use it in GitHub Desktop.
Log exception with stackdriver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def log_exception(e, message_format="{} Exception"): | |
logger.log_struct({ | |
"message": message_format.format(type(e)), | |
"exc_info": traceback.format_exc(limit=20).split("\n") | |
}, severity="ERROR") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment