Skip to main content

Informative Stacktrace that shows everything on the stack

Project description

Fattrace

Provides an informative (fat) stacktrace that shows everything on the stack.

Examples

Before:

After:

Highlights

  • Removes the need for printf and debugger
  • Special handling for array-like objects which have members that are named one of:
    • dtype
    • shape
    • device
    • layout
  • Similar to tbvaccine, optionally ignores frames from external libraries

Usage

Run fattrace.install() anywhere to replace the standard stack-trace hook (sys.excepthook).

Customization is done by the keyword arguments:

def install(threshold:int=3,
            include_self:bool=True,
            include_private:bool=False,
            include_external:bool=False,
            ignore:set[str]={},
            ignore_type:set[type]={},
            ):
    ...
  • threshold : the maximum number of elements to print in a list, tuple, dict, etc.
  • include_self : in a method call, whether to print the members of self.
  • include_private : If true, private variables and members whose names start with "__" are excluded from the trace.
  • include_external : if false (default), include assignments only if the code is under the current directory.
  • ignore : A set of strings. Variables and members matching any of the names are excluded from the trace.
  • ignore_type : A set of types. Variables and members matching any of the types are excluded from the trace.

License

MIT

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

fattrace-0.0.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fattrace-0.0.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file fattrace-0.0.1.tar.gz.

File metadata

  • Download URL: fattrace-0.0.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for fattrace-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5297651cf488540587eac198c4ff5e15165e4797c8c4a47da7c3ac8553b581ee
MD5 c33793af2cac50bdc365e4643588e021
BLAKE2b-256 4f499a417f155385cea7fa5395420887f77bf1c366d8f4cfb16517f4742e35c7

See more details on using hashes here.

File details

Details for the file fattrace-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: fattrace-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for fattrace-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1717deccbe55d2e16c0fb3e3322e0df618a7a57f6c5f9e96c79821e7ec232904
MD5 8709df62653a193422acc53202300626
BLAKE2b-256 3efbe37377ffc70e251e3f1349a3c22e6c56067cf489803e321c69867fb0feb9

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