-
Notifications
You must be signed in to change notification settings - Fork 154
Replace log crate with tracing in host code #1044
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: dblnz <13020154+dblnz@users.noreply.github.com>
Co-authored-by: dblnz <13020154+dblnz@users.noreply.github.com>
| spin = "0.10.0" | ||
|
|
||
| [features] | ||
| default = ["tracing"] |
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 not sure if we want to remove the #[instrument] condition from hyperlight-common. But, considering the hyperlight guests can now use the same tracing crate as the host, I think this would be fine
|
|
||
| impl FunctionCall { | ||
| #[cfg_attr(feature = "tracing", instrument(skip_all, parent = Span::current(), level= "Trace"))] | ||
| #[instrument(skip_all, parent = Span::current(), level= "Trace")] |
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 think we can remove parent = Span::current() because it is the default and it is redundant
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.
Removed parent = Span::current() from all 49 occurrences in flatbuffer_wrappers files and removed the now-unused Span imports. (f4dd6d2)
|
@copilot look at the suggestions |
Co-authored-by: jsturtevant <648372+jsturtevant@users.noreply.github.com>
Plan: Replace
logcrate withtracing- ✅ COMPLETElogcratelogimports withtracingequivalents in source files:parent = Span::current()from instrument attributes (it's the default)Summary of Changes
Replaced in host code:
log::error!→tracing::error!log::warn!→tracing::warn!log::info!→tracing::info!log::debug!→tracing::debug!log::trace!→tracing::trace!log::Level→tracing::Levelwith correct constants (TRACE, DEBUG, INFO, WARN, ERROR)parent = Span::current()from all instrument attributesIntentionally kept log crate in:
This is correct because guest code implements
log::Logtrait for the host-guest logging bridge.Original prompt
tracingcrate instead oflogto create logs #1028✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.