-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add logs using logs
#223
Add logs using logs
#223
Conversation
More logs can be added if #222 is accepted and merged, so I leave this PR in draft for 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.
- If you change the dependency to be on the
logs
crate, then you won't have to conditionalize the logging code at all, which will provide an enormous simplification. (See my comments on Add logs support #221 for other reasons I prefer logs to tracing.) - When creating an entry, please be sure to log the credential-store-specific attributes being used as well as the credential store. (Since all of the stores derive Debug, you can just debug print the credential into the log.)
- When operating on an entry, be sure to debug log the entry. That way it can be correlated to where the entry was created.
- I suggest you move logging of the target, service, and user into the platform-independent code, which saves you adding it to the credential-store code. Then the credential-store code can just debug log the credential being operated on.
303424b
to
6dd0633
Compare
Also used env_logger for tests.
The PR is ready for review. In fact it can be mergde before or after #222, it does not matter. I try to apply what you asked for, let me know if it's what you have in mind. I added |
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.
This looks very good, thank you! Minor language cleanups and format cleanups and a question for you to consider.
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.
Perfect! Thanks so much for this! I will merge it right away, so you can rebase #222 on it.
Closes #221.
This PR adds basic log support using the
tracing
crate. It gives more context to users about what is going on insidekeyring-rs
.