-
Notifications
You must be signed in to change notification settings - Fork 72
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
Update all logging references to use loguru #2031
Update all logging references to use loguru #2031
Conversation
6f8888c
to
b720512
Compare
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.
I tried making some privacy requests with errors because I know this is an area we were not getting logs before, and I am seeing them now so this seems to have worked.
It would be nice if we could add a linting rule to prevent the use of the default logger so we don't accidentally get back in the same situation. I looked for a pylint plugin that might be able to do it, but didn't find anything. It was also not easy to search for because the results were assuming trying to solve an import error rather than preventing an import so I could just be missing one. It's a "nice to have" and not mandatory.
Thanks @adamsachs will review shortly! |
@adamsachs just starting to review, but I'm still seeing a lot of instances of where the old built-in |
whoops, yeah i think i missed a few. the uses in update -- just realized my vscode global search was only searching open files 🤦 |
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 taking this on Adam -
Switch to use {} loguru formatting Update Pii class to work with loguru lazy formatting Include a new, proper log_pii config var
e6a7cc4
to
925e8cc
Compare
…uru-to-stop-logs-getting-suppressed
I think the big fideslib merge caused these issues, I'm going to take a look |
…uru-to-stop-logs-getting-suppressed
@adamsachs I'm overnighting a cape to you, thank you for tackling this! |
thanks proactively pushing this forward with the merge @ThomasLaPiana! i think we're just waiting on a re-review from @pattisdr before we can merge this. |
looking now! |
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 so much for taking this on @adamsachs! I added a last commit I was going through your changes, let me know if that looks ok -
more than ok @pattisdr! thank you for that last bit of cleanup! i think we're good to go now :) |
this commit sets the correct name of the Fides log pii env var (as changed in ethyca/fides#2031) and changes the default logging level from debug --> info
Update to use
loguru
instead of built-inlogging
Closes #1842
Code Changes
loguru
logging.log_pii
config propertySteps to Confirm
Follow-up issues
logging
references intests/
#2041Pre-Merge Checklist
CHANGELOG.md
Description Of Changes
Most of this is pretty straightforward find-replace.
The only change that required some thought was the
Pii
updates, since before we'd been creating our ownLogRecordFactory
- there may have been a straightforward way of mimicking this functionality inloguru
, but it wasn't immediately apparent to me, so i decided to switch up the implementation a bit. What I arrived at should be functionally equivalent, and I think it's quite a straightforward implementation.I also decided to add in a proper
logging.log_pii
app config property, since we were just relying on a environment var beforehand outside of the general config framework. perhaps there was a reason for having it done that way? i couldn't see one, so i figured it made more sense to properly account for it as an app config property/setting.A couple of notes:
get_task_logger
reference inrequest_runner_service.py
because I couldn't find a quick way to integrate that withloguru
. this seems to be some functionality we may want, so i think it probably deserves some further attention. but i didn't want to hold up this PR on that, since we need to get overall logging back ASAP. (note that the logging in this file is not coming through at all on the currentmain
, so this still represents an improvement). I can create a follow up ticket to handle this if we think it's necessary.logging
references in our tests. I wasn't sure if this was in scope - I could see it going either way. regardless, it's not as high priority as the app code updates, and we want to get this out ASAP, so I decided to hold off. I can also create a follow up ticket for those updates if we want.