Created
July 15, 2014 06:49
-
-
Save wbbradley/baed2cf413bd069a57e3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import traceback | |
def log_stack(): | |
with open('/var/tmp/stacktraces.log', 'a') as f: | |
f.write("-" * 80 + "\n") | |
f.write("\n".join(repr(s) for s in traceback.extract_stack() | |
if s[0].find('virtualenv') == -1 | |
and s[0].find('System') == -1 | |
and s[2].find('wrapped') == -1 | |
and s[2].find('decorated_function') == -1 | |
)) | |
f.write("\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment