Skip to main content

Importing this module enables automatic post mortem debugging upon any exception. It uses module specified in envvar

Project description

Overview

This is a simple module which enables you to have automatic post-mortem debugging as simply as possible

Usage

Install it using pip install autodebug.

Then in your Python script, before the possible exception write

import autodebug

Then if any uncaught exception happens, you’ll be immediately transferred to debugger. Exactly the moment before the exception occured. So you’ll have access to all variables and everything.

Debugger

You can specify which Python debugger you want to use.

To do that simply set the environmental variable AUTO_DEBUG. Possible debuggers currently are:

  • pdb for built-in Python debugger

  • ipdb for ipdb Python debugger

  • pudb for full-screen console Python debugger.

If you do not set the variable, pdb will be used, as it is built-in.

Post notes

  • Please note that this module uses custom sys.excepthook, so if you are using your own, this module will not work, or will overwrite your excepthook (This depends on order of import and setting your own excepthook)

  • In order to make it work with uwsgi you have to pass --honour-stdin to uwsgi configuration. This will make it possible to debug uwsgi applications!. But keep in mind, that if you’ve got more than 1 worker, and multiple people are using your application, the terminal output will be ugly.

  • The debugger won’t start if it is imported inside interactive console, so it may not work in some IDEs. Experiment yourself, however it is adviced to start your programs using command line.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autodebug-1.0.1.tar.gz (2.2 kB view details)

Uploaded Source

File details

Details for the file autodebug-1.0.1.tar.gz.

File metadata

  • Download URL: autodebug-1.0.1.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for autodebug-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2bfb2ad783d877114c1c80d406a2624e0aa5a25d3dbacdf4b9cc4cc9d860c20a
MD5 6438cea12e4f1606387fa46c4523c924
BLAKE2b-256 bf3e1f15a0fcf8dd34df305bb661b65bad98984f251f4a779741d3c2000777d4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page