API¶
Public functions¶
initialize()¶
Enables custom traceback formatting
import better_trace
better_trace.initialize()
revert()¶
Disables custom traceback formatting
import better_trace
better_trace.revert()
demo()¶
Displays a traceback for demonstration purposes
import better_trace
better_trace.demo()
Configuration for initialize()¶
better_trace.initialize(
show_locals=True,
log_exceptions=False,
debugger=False,
mode="verbose",
theme="monokai",
background_color="default",
)
Option |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Shows locals at crash site |
|
|
|
Logs exceptions to |
|
|
|
Enables |
|
|
|
Output style ( |
|
|
|
The syntax highlighting theme |
|
|
|
The background color |
Behavior¶
This tool overrides the global Python exception handler (sys.excepthook) for the current process.