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

Enhancement: Log tracebacks to console in debug mode #958

Closed
provinzkraut opened this issue Dec 17, 2022 · 2 comments · Fixed by #976
Closed

Enhancement: Log tracebacks to console in debug mode #958

provinzkraut opened this issue Dec 17, 2022 · 2 comments · Fixed by #976
Assignees
Labels
Enhancement This is a new feature or request Good First Issue This is good for newcomers to take on

Comments

@provinzkraut
Copy link
Member

Currently exceptions are silenced when in debug mode and only show up in the responses.

The exception middleware should be changed such that when in debug mode, errors and their tracebacks are logged to the console.

@provinzkraut provinzkraut added Enhancement This is a new feature or request Good First Issue This is good for newcomers to take on labels Dec 17, 2022
@JacobCoffee
Copy link
Member

Assign this to me please, I'll attempt to fix this weekend

@Goldziher
Copy link
Contributor

done

@provinzkraut provinzkraut linked a pull request Jan 27, 2023 that will close this issue
4 tasks
Goldziher added a commit that referenced this issue Feb 4, 2023
* feat: add console output for exceptions in debug mode

* chore: middleware debug logging updates

* feat: #958 testing passing

* Update starlite/middleware/exceptions/middleware.py

Co-authored-by: Na'aman Hirschfeld <[email protected]>

* chore: fixed test for middleware debug logging (#958)

* Update tests/middleware/test_exception_handler_middleware.py

* chore: fixed test for middleware debug logging (#958)

* Use `get_logger` fixture to test exception logged in debug.

- moves get_logger fixture to conftest.py for middleware tests
- patches app logger in tests with one that propagates so caplog works.

* chore: Updated assertions (#958)

* Update starlite/middleware/exceptions/middleware.py

Co-authored-by: Na'aman Hirschfeld <[email protected]>

* chore: update logger method

---------

Co-authored-by: Jacob Coffee <[email protected]>
Co-authored-by: Cody Fincher <[email protected]>
Co-authored-by: Na'aman Hirschfeld <[email protected]>
Co-authored-by: provinzkraut <[email protected]>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Peter Schutt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This is a new feature or request Good First Issue This is good for newcomers to take on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants