Skip to content

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

@mustafa0x

Description

@mustafa0x

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions