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

Use repr in logging for exception. #1185

Merged
merged 1 commit into from Jan 23, 2023

Conversation

Carreau
Copy link
Contributor

@Carreau Carreau commented Jan 23, 2023

And use exc_info=True instead of a separate log.exception to make sure the tb is attached to the right log message.

Using %s can have issue when logging error as it may hide informations like the type of exception. If for example you have an assertion error, %s will give you the empty string, which is not informative.

On the other hand, %r will at least give you AssertionError(), which is a start.

And use exc_info=True instead of a separate log.exception to make sure
the tb is attached to the right log message.

Using `%s` can have issue when logging error as it may hide informations
like the type of exception. If for example you have an assertion error,
%s will give you the empty string, which is not informative.

On the other hand, %r will _at least_ give you `AssertionError()`, which
is a start.
@codecov
Copy link

codecov bot commented Jan 23, 2023

Codecov Report

Base: 79.93% // Head: 80.16% // Increases project coverage by +0.23% 🎉

Coverage data is based on head (9b6946b) compared to base (a52709c).
Patch coverage: 12.50% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1185      +/-   ##
==========================================
+ Coverage   79.93%   80.16%   +0.23%     
==========================================
  Files          68       68              
  Lines        8124     8149      +25     
  Branches     1601     1605       +4     
==========================================
+ Hits         6494     6533      +39     
+ Misses       1205     1189      -16     
- Partials      425      427       +2     
Impacted Files Coverage Δ
jupyter_server/nbconvert/handlers.py 79.09% <0.00%> (ø)
jupyter_server/serverapp.py 79.92% <0.00%> (ø)
jupyter_server/services/contents/filemanager.py 75.27% <0.00%> (ø)
jupyter_server/extension/manager.py 93.13% <100.00%> (+0.79%) ⬆️
jupyter_server/services/sessions/handlers.py 79.20% <0.00%> (-1.95%) ⬇️
jupyter_server/extension/application.py 73.36% <0.00%> (ø)
jupyter_server/services/contents/checkpoints.py 88.40% <0.00%> (ø)
jupyter_server/gateway/managers.py 83.41% <0.00%> (+0.03%) ⬆️
jupyter_server/services/contents/manager.py 85.39% <0.00%> (+0.09%) ⬆️
jupyter_server/utils.py 85.46% <0.00%> (+0.17%) ⬆️
... and 9 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@blink1073 blink1073 merged commit 91c5942 into jupyter-server:main Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants