Skip to main content

Generate Python trace log in HTML

Project description

Disptrace traces Python code execution, generating HTML file to display execused line of codes. The resulting HTML has navigation menu to collapse function calls or hide paticuler modules and functions.

Usage

Create disptrace.Disptrace object as trace module in Python standard library, and invoke target function to be traced as follow:

import disptrace
t = disptrace.DispTrace()
t.runfunc(myfunc)
with open("trace.html", "w") as f:
    f.write(t.render())

DispTrace.render() method generates HTML string of the information.

~/.disptrace file

You can create ~/.disptrace file to specify default value of ignoremods and ignoredirs in ConfigParser style ini file:

[disptrace]
ignorepath=/usr/local/lib/python2.6/dist-packages/:/usr/lib/python2.6/plat-linux2
ignoremodule=sys, os

ignorepath is a list of directories whose modules or packages should be ignored. Each path should deilmited by os.path.pathsep character (‘:’ in Unixes, ‘;’ in Windows).

ignoremodule list of modules or packages to ignore. Each modules should be delimited by ‘,’ character.

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

disptrace-0.4.tar.gz (7.3 kB view details)

Uploaded Source

File details

Details for the file disptrace-0.4.tar.gz.

File metadata

  • Download URL: disptrace-0.4.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for disptrace-0.4.tar.gz
Algorithm Hash digest
SHA256 d2c6f194e002f1d4e5c0743c4f32969cd1413077a3b32ae5224606ac715fd3c6
MD5 b93459c4f89bd01ac7428ef0fa2e2fc6
BLAKE2b-256 859c0093598595d42266bc96de808b7476415d1d7dd387dfa25f117a83a130a5

See more details on using hashes here.

Supported by

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