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

[REQUEST] logging exceptions: highlight paths to my code #3492

Closed
mustafa0x opened this issue Sep 15, 2024 · 4 comments
Closed

[REQUEST] logging exceptions: highlight paths to my code #3492

mustafa0x opened this issue Sep 15, 2024 · 4 comments

Comments

@mustafa0x
Copy link

mustafa0x commented Sep 15, 2024

In exceptions, can rich automatically highlight paths of my code, to be able to distinguish from code in the virtualenv or external packages. For example, in the following exception, the middle path should be highlighted.

/Users/mustafa/Library/Caches/pypoetry/virtualenvs/foobar-Ra8Pwy-F-py3.12/lib/python3.12/site-packages/ninja/main.py:515
/Users/mustafa/dev/project/api.py:38
/Users/mustafa/Library/Caches/pypoetry/virtualenvs/foobar-Ra8Pwy-F-py3.12/lib/python3.12/site-packages/ninja/operation.py:121

Benefits

  • Faster error source identification: Instantly spot errors in your code vs. external libraries.
  • Improved debugging efficiency: Quickly determine if an issue is in your code or a third-party library.

edit: claude suggested using excepthook. not sure if the solution makes sense.

Copy link

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

@willmcgugan
Copy link
Collaborator

You can exclude known libraries from tracebacks.

Copy link

github-actions bot commented Nov 1, 2024

I hope we solved your problem.

If you like using Rich, you might also enjoy Textual

@mustafa0x
Copy link
Author

I want to exclude (or more accurately, de-emphaszie) everything in the venv.

Like vscode has a justMyCode configuration option.

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

No branches or pull requests

2 participants