snowflake-connector-python icon indicating copy to clipboard operation
snowflake-connector-python copied to clipboard

Convert print statements to logging statements

Open invisiblethreat opened this issue 1 year ago • 5 comments

Please answer these questions before submitting your pull requests. Thanks!

  1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes #1892

  2. Fill out the following pre-review checklist:

    • [ ] I am adding a new automated test(s) to verify correctness of my new code
    • [x] I am adding new logging messages
    • [ ] I am adding a new telemetry message
    • [ ] I am modifying authorization mechanisms
    • [ ] I am adding new credentials
    • [ ] I am modifying OCSP code
    • [ ] I am adding a new dependency
  3. Please describe how your code solves the related issue.

    The use of print breaks piping outputs, as the output is contaminated with the message when using exteranlbrowswer authentication. Moving these messages into logging allows for pipelining, and also elevating the the failure mode to a more suitable level of urgency.

invisiblethreat avatar Feb 29 '24 22:02 invisiblethreat

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

github-actions[bot] avatar Feb 29 '24 22:02 github-actions[bot]

I have read the CLA Document and I hereby sign the CLA

invisiblethreat avatar Feb 29 '24 22:02 invisiblethreat

recheck

invisiblethreat avatar Feb 29 '24 22:02 invisiblethreat

@invisiblethreat could you fix the unit tests too and use logging.caplog to match what the old test was testing

sfc-gh-aalam avatar Mar 01 '24 18:03 sfc-gh-aalam

@sfc-gh-aalam Had some issues getting tests to run as expected locally, but built out some toy scripts to assess the functionality of caplog and the resulting changes should restore tests. 🤞

invisiblethreat avatar Mar 01 '24 21:03 invisiblethreat