-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add Logging to Geolocation #185
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed
modules/geolocation/geolocation.py
Outdated
except: | ||
# TODO: Logging | ||
frame = inspect.currentframe() | ||
self.__logger.error("could not get perspective transform matrix", frame) | ||
return False, None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
except cv2.error as e:
# log the specific cv2 error
return False, None
except Exception as e:
# log the specific unexpected error type
return False, None
modules/geolocation/geolocation.py
Outdated
for detection_in_world in detections_in_world: | ||
frame = inspect.currentframe() | ||
self.__logger.info(detection_in_world, frame) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should log each one as it's created in the for loop above (after we append it to the list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conditionally approved.
modules/geolocation/geolocation.py
Outdated
@@ -45,6 +57,10 @@ def create( | |||
# Image space to camera space | |||
result, value = camera_intrinsics.camera_space_from_image_space(source[0], source[1]) | |||
if not result: | |||
frame = inspect.currentframe() | |||
geolocation_logger.error( | |||
f"rotated source vector could not be created for source: {source}", frame |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalize. Same for logging statements below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I noticed in main the logger outpus main logger initialized
which is why I did all lowercase. Should those be changed as well?
Add Logging to Geolocation
Key Changes
DetectionInWorld
Testing
test_geolocation_worker
integration test works and confirm logs are logged as expectedOutput from log file