-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add loguru for logging #282
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
Conversation
raghu017
commented
May 25, 2023
- Add loguru for logging
- Change PII logging to debug only
Hi @isafulf, this is part of the improvements we are making for Azure Open AI. This project already had a dependency on loguru (by indirect reference), so @raghu017 is migrating all of the print statements to it along with switching all PII to debug statements. Let us know if there is anything you need from us. |
@isafulf Can you take a look at the PR? |
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.
Thanks for doing this! Have you tested this yourself?
@@ -252,7 +253,7 @@ def create_results(data): | |||
QueryResult(query=query.query, results=results) | |||
) | |||
except Exception as e: | |||
print("error:", e) | |||
logger.exception("error:", e) |
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.
Doesn't logger.exception already logs the stack trace along with the error message?
So: logger.exception("<descriptive message>")
should be sufficient, this applies to all cases in the PR
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.
Pushed new changes, replaced exception with error. Exception is verbose stack trace and it is logging PII. Yes this is tested.
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.
LGTM thanks!