Skip to main content

Produce function trace for Python code in Xdebug format

Project description

This module prints function trace to stdout from the moment it is called:

import xtrace
xtrace.start()
...
xtrace.stop()

It is also possible to call xtrace as module from the command line:

python -m xtrace <script.py> [param] ...

or use as a standalone script:

python xtrace.py <script.py> [param] ...

The output format is that of Xdebug http://xdebug.org/docs/execution_trace But frankly, I didn’t have time to polish it to be exactly the same. If you will find the time and desire to polish it - feel free to send a patch.

This code is released into public domain. Enjoy!

History

  • 0.3 - fix AttributeError when running from console (issue #2)

  • 0.2 - added version info, support running from command line, moved main functions into a class to isolate used variables in local namespace

  • 0.1 - initial release

Credits

Amaury Forgeot d’Arc, for valuable insight into Python internals

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

xtrace-0.3.tar.gz (2.5 kB view details)

Uploaded Source

File details

Details for the file xtrace-0.3.tar.gz.

File metadata

  • Download URL: xtrace-0.3.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xtrace-0.3.tar.gz
Algorithm Hash digest
SHA256 4064890db29d5712e68013f727a6204e796996ba7d304c5f3864b71115aad9c8
MD5 4791d296737818983ce7f437bbb879db
BLAKE2b-256 e62b74fae8a9c6acb0461e31b3fc46e4597ae7df8cdc3bdb48a28baaeb8b87e5

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