Skip to content

Instantly share code, notes, and snippets.

@tmacam
Created November 5, 2012 18:07
Show Gist options
  • Save tmacam/4019350 to your computer and use it in GitHub Desktop.
Save tmacam/4019350 to your computer and use it in GitHub Desktop.
Simple Flask app to collect backtraces.
#!/usr/bin/env python -u
# vim:ts=4:sts=4:sw=4:et:wrap:ai:fileencoding=utf-8:
from flask import Flask, request
app = Flask(__name__)
@app.route('/', methods=['POST', 'GET'])
def collect_backtrace():
data = str(request.data)
with open('backtrace.txt', 'a') as fh:
fh.write(data + '\n')
fh.flush()
print data
return "", 200
if __name__ == '__main__':
app.run(debug=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment