Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ignore_files and ignore_brief_files Format #30

Open
shaoerkuai opened this issue Nov 27, 2024 · 2 comments
Open

Add ignore_files and ignore_brief_files Format #30

shaoerkuai opened this issue Nov 27, 2024 · 2 comments

Comments

@shaoerkuai
Copy link

shaoerkuai commented Nov 27, 2024

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: 
@andy-landy
Copy link
Owner

andy-landy commented Dec 3, 2024

Hi, thanks for a use case.

Does brief_files_except='D:\xxx' do the job? or skip_files_except

@shaoerkuai
Copy link
Author

shaoerkuai commented Dec 5, 2024

I think a regx list is better for more scenarios?
brief_files_except_ = [''] # a regx list for filter the unnecessary files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants