Skip to main content

A tool to customize exception tracebacks to show file, line number, and code line

Project description

lineup

lineup is a lightweight Python utility that globally formats and prints detailed tracebacks for all exceptions — both uncaught and handled. It's a powerful debugging tool to help you better understand error behavior across your codebase.

Features

  • Clean, readable formatting of Python tracebacks
  • Captures all exceptions, even those caught in try blocks
  • Automatically activates for both the main thread and additional threads
  • Simple one-line activation

Installation

pip install lineup

Usage

Call detail() early in your script or application:

from lineup import detail

detail()

Once active, all exceptions—whether caught or uncaught—will be printed in a readable format:

Traceback (most recent call last):
File "example.py", line 10, in my_function
    result = 1 / 0
ZeroDivisionError: division by zero

This includes exceptions inside try/except blocks, providing visibility into all error events.

Example

from lineup import detail

detail()

def foo():
    try:
        raise ValueError("Oops!")
    except ValueError:
        pass  # This would still be printed thanks to `lineup`

foo()

Output:

Traceback (most recent call last):
  File "example.py", line 6, in foo
    raise ValueError("Oops!")
ValueError: Oops!

How It Works

  • Overrides sys.excepthook to format uncaught exceptions.
  • Uses sys.setprofile and threading.setprofile to monitor all raised exceptions, even inside try/except.
  • Ignores KeyboardInterrupt and SystemExit to avoid clutter during normal exits.

When to Use

  • During development and debugging
  • When you want full visibility into exception flow
  • In multi-threaded applications where tracebacks can be hard to track

⚠️ This tool is not recommended for production environments where performance or clean logs are critical.

License

MIT License

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

lineup-0.0.2.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

lineup-0.0.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file lineup-0.0.2.tar.gz.

File metadata

  • Download URL: lineup-0.0.2.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for lineup-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b4826fcbbc7b7b14606a6ca79361ee9358ac3dcaf5357518af1a3a2f9a6f5d8b
MD5 ef2e6ea5eb12de1ff18b039ec6434147
BLAKE2b-256 0fc3c27559ad270f92079a7fc0777627b1a6e8b834e02b048539f88f65fb7077

See more details on using hashes here.

File details

Details for the file lineup-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: lineup-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for lineup-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3a1ff9cdf1cd42480a4119f07c84b542b5980d00b8d0ab461dd02275506ae3c1
MD5 9b86a5896ecdf9b7f61f7c35659c0bb4
BLAKE2b-256 6764915d0a7c558a9fab3b7d0fd46317a979b48f4b5b6bd8629f652e8286d545

See more details on using hashes here.

Supported by

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