tkrajina / gpxpy

gpx-py is a python GPX parser. GPX (GPS eXchange Format) is an XML based file format for GPS tracks.
Apache License 2.0
1.02k stars 223 forks source link

Shouldn't use logging.exception() #111

Closed hyperknot closed 6 years ago

hyperknot commented 6 years ago

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 commented 6 years ago

PR submitted: https://github.com/tkrajina/gpxpy/pull/112

tkrajina commented 6 years ago

Merged, thanks.