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

Coverage of logging is poor #600

Open
1 task done
Mec-iS opened this issue Jul 26, 2021 · 2 comments
Open
1 task done

Coverage of logging is poor #600

Mec-iS opened this issue Jul 26, 2021 · 2 comments

Comments

@Mec-iS
Copy link
Contributor

Mec-iS commented Jul 26, 2021

I'm submitting a

  • 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

@farazkhanfk7
Copy link
Member

I think @Purvanshsingh was working on this. But later it was removed. Do we have to add it again ?

@Mec-iS
Copy link
Contributor Author

Mec-iS commented Jul 26, 2021

Yes let's keep this with low priority. Logging is fundamental for proper maintenance.

@HTTP-APIs HTTP-APIs deleted a comment from kunatastic Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants