hydrus
hydrus copied to clipboard
Coverage of logging is poor
I'm submitting a
- [x] feature request.
Current Behaviour:
Logging is only present in app.py
.
Logging is seldommly used. For example in the case of delete_collection_member
:
try:
session.commit()
except InvalidRequestError:
session.rollback()
return collection_id
Expected Behaviour:
The function above issues a rollback without logging. Rolling back operations are importanto to highlight for maintance reason, so it should look like:
try:
session.commit()
except InvalidRequestError as e:
session.rollback()
logging.warning("Rollback in [function name] because of {str(e)}")
[raise 400]?
return collection_id
It would be nice to take this opportunity to implement structured logging with structlog
I think @Purvanshsingh was working on this. But later it was removed. Do we have to add it again ?
Yes let's keep this with low priority. Logging is fundamental for proper maintenance.