Giter Site home page Giter Site logo

tracebin's Introduction

tracebin

Tracebin is a small flask application to receive Python tracebacks formatted with offlinetb. Simply POST the resulting JSON to the root url, and the app sends back the resulting uuid:

POST / HTTP/1.0
...

<<traceback data here>>

Returns:

HTTP/1.0 200 OK
Content-type: application/json
Content-Length: 107
...

{
    "id": "d9c7d8c5974911e189b7c82a1414d2bb",
    "url": "http://yoursever.com/d9c7d8c5974911e189b7c82a1414d2bb"
}

Subsequently, when you try to browse the resulting URL with a web browser, you'll be able to interactively explore the traceback and its frames.

This is particularly useful when deploying in-house solutions which occasionally fail and would like to report the failure details to a centralized location. This small utility enables you to just save the traceback URL and link to it from anywhere you want.

Example Code to Distill and Send Tracebacks

Below is a quick example of how you might use tracebin to save tracebacks:

import json
import urllib2
import offlinetb

try:
   some_function_that_might_raise_exceptions()
except Exception:
   response = urllib2.urlopen("http://your.tracebin.server/", json.dumps(offlinetb.distill()))
   traceback_url = json.loads(response.read())['url']

Installation

  1. Clone the repository to anywhere you want (say /opt/tracebin/ on your server)

  2. (optional) Create a Python virtualenv to run your application: virtualenv /opt/tracebin/env

  3. Install requirements:

    /opt/tracebin/env/bin/pip install -r /opt/tracebin/env/src/pip_requirements.txt
    
  4. To run the server as scgi, just run:

    /opt/tracebin/env/bin/python /opt/tracebin/src/app.py scgi -d /your/data/dir -s /path/to/socket/file
    
  5. If you'd like your app to be installed on some URL path other than '/', use the '-r' flag to specify a url prefix

tracebin's People

Contributors

omergertel avatar vmalloc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.