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
tryblocks - 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.excepthookto format uncaught exceptions. - Uses
sys.setprofileandthreading.setprofileto monitor all raised exceptions, even insidetry/except. - Ignores
KeyboardInterruptandSystemExitto 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4826fcbbc7b7b14606a6ca79361ee9358ac3dcaf5357518af1a3a2f9a6f5d8b
|
|
| MD5 |
ef2e6ea5eb12de1ff18b039ec6434147
|
|
| BLAKE2b-256 |
0fc3c27559ad270f92079a7fc0777627b1a6e8b834e02b048539f88f65fb7077
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a1ff9cdf1cd42480a4119f07c84b542b5980d00b8d0ab461dd02275506ae3c1
|
|
| MD5 |
9b86a5896ecdf9b7f61f7c35659c0bb4
|
|
| BLAKE2b-256 |
6764915d0a7c558a9fab3b7d0fd46317a979b48f4b5b6bd8629f652e8286d545
|