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

Shouldn't use logging.exception() #111

Closed
hyperknot opened this issue Apr 3, 2018 · 2 comments
Closed

Shouldn't use logging.exception() #111

hyperknot opened this issue Apr 3, 2018 · 2 comments

Comments

@hyperknot
Copy link
Contributor

In the parser.py file, there is a debug log and directly after, there is a .exception log:

https://github.com/tkrajina/gpxpy/blob/master/gpxpy/parser.py#L144-L145

This is actually raising an ERROR level log, triggering all kind exception watchers like Sentry, as well as polluting the logs for benign things. The first line is a .debug() line for a reason, I believe.

This is not how exceptions should be logged in Python. You can add them to the debug line, as listed here:
https://docs.python.org/2/library/logging.html#logging.Logger.debug

@hyperknot
Copy link
Contributor Author

PR submitted: #112

@tkrajina
Copy link
Owner

tkrajina commented Apr 4, 2018

Merged, thanks.

@tkrajina tkrajina closed this as completed Apr 4, 2018
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