-
Notifications
You must be signed in to change notification settings - Fork 2k
Tracing filter #3971
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
Closed
JonathanWoollett-Light
wants to merge
3
commits into
firecracker-microvm:main
from
JonathanWoollett-Light:tracing-final
Closed
Tracing filter #3971
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Would it make sense to hide
tracing::{error,info,...}
behindlogging::{error,info,...}
. What I am thinking is that, if we do that, we will not be hardly dependant ontracing
crate everywhere. That way, if we ever decide that we want to use something else, other thantracing
we won't have to make changes everywhere.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.
logging::error
used to re-exportlog::error
(e.g.pub use log::error;
). We could also re-exporttracing::error
but I don't like this, I find re-exports add complexity and reduce readability.I understand your point if we wanted to change away from
tracing
but I don't think it's valuable for this PR to be designed considering it may be reverted.I think using
tracing::error
(etc.) is the simplest and best approach (I think if we avoid this with wrapping here, the same point could be argued in many cases and not be useful).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 don't have a super strong opinion here, but I do not understand how re-exporting adds complexity or reduces readability. Re-exporting just renames something. Also, it removes the need to "polute" Cargo.toml with both
logger
andtracing
.I think it's worth getting more opinions here
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.
Mh, I can see a few (weak) arguments for re-exporting
tracing
as a dependency to a bunch ofCargo.toml
files (however we're in the process of merging all crates, so this will resolve itself either way)log::error!
->tracing::error
(however we dont tend to fully qualify our logging calls, instead mostly opting for importing the macros at the top of the file).Overall I think reexporting would be nicer (diff would be a bit smaller, and we avoid having to specify the dependency a ton of times), but I also don't have a strong opinion.
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 am in favor of reexporting. Makes simpler imports + less dependency declarations.
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've updated it to maintain the same re-exporting pattern.
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.
Sorry, I didn't get it. Do you mean you don't want to use re-export? (The first commit is not re-exporting, just replacing
use log::*
withuse tracing::*
everywhere