Adds variables to python traceback. Simple, lightweight, controllable. Debug reasons of exceptions by logging or pretty printing colorful variable contexts for each frame in a stacktrace, showing every value. Dump locals environments after errors to console, files, and loggers. Works in Jupyter and IPython. Install with pip or conda.
MIT License
682
stars
27
forks
source link
Add ignore_files and ignore_brief_files Format #30
Now it supports filter the specific files to be printed, but sometimes I just want to remove unnecessary frames likely from my global catch decorator rather than only shows fixed packages, so I think it's good to filter this..
Example:
Traceback with variables (most recent call last):
~~ File "D:\Program Files\Python38\lib\site-packages\THIS_FRAME_I_WANT_TO_REMOVE.py", line 69, in wrapper~~
~~ . try:~~
~~ > return func(*args, **kwargs)~~
~~ args = ('a', 'b', 'c')~~
~~ kwargs = {}~~
~~ e = RuntimeError()~~
~~ catch_traceback = True~~
~~ func = <function test_exception at 0x000001C3944AC430>~~
~~ print_in_env = True~~
~~ print_signature = True~~
~~ re_raise = True~~
File "D:\xxx\xxx\library\common\test.py", line 18, in test_exception
. print("the function raises error")
> raise RuntimeError
d = 'xxx'
e = 'xxx'
f = 'xxx'
builtins.RuntimeError:
Now it supports filter the specific files to be printed, but sometimes I just want to remove unnecessary frames likely from my global catch decorator rather than only shows fixed packages, so I think it's good to filter this..
Example: