Conversation
489acde to
7ff7b03
Compare
7ff7b03 to
58caf0d
Compare
| fn convert_level_filter(filter: tracing::log::LevelFilter) -> tracing_core::LevelFilter { | ||
| match filter { | ||
| tracing::log::LevelFilter::Off => tracing_core::LevelFilter::OFF, | ||
| tracing::log::LevelFilter::Error => tracing_core::LevelFilter::ERROR, | ||
| tracing::log::LevelFilter::Warn => tracing_core::LevelFilter::WARN, | ||
| tracing::log::LevelFilter::Info => tracing_core::LevelFilter::INFO, | ||
| tracing::log::LevelFilter::Debug => tracing_core::LevelFilter::DEBUG, | ||
| tracing::log::LevelFilter::Trace => tracing_core::LevelFilter::TRACE, | ||
| } |
There was a problem hiding this comment.
Is it possible to tracing_core::LevelFilter everywhere instead of having this? (in entrypoint of hyperlight_guest_bin + whatever the host passes to the guest)?
There was a problem hiding this comment.
I think it is doable, I just wanted to avoid breaking changes.
But I think we'll have breaking changes this release anyway
There was a problem hiding this comment.
It turns out it's more complicated that I had anticipated.
First of all, tracing_core::LevelFIlter cannot be cast to u64 as an entrypoint argument. So, we still need to do some conversions.
Secondly, the logger inside the guest, still needs a log::LevelFilter.
The solution I've used is to have a separate hyperlight_common::log_level::GuestLogFilter that can convert from/to u64 and from/to LevelFilter (both log/tracing ones).
I think this is a short term solution, because I am going to eliminate the logger inside the guest, to only use the tracing approach across the guests logs and traces. That will eliminate the need for log::LevelFilter.
Let me know your opinion on this.
|
@dblnz would you like to get this into the next release (we have it scheduled for next week (Feb 25th) |
58caf0d to
3f6bb07
Compare
Yes, I'm rebasing it to include it in the release |
…arent Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
4fc6b1c to
6e47f8f
Compare
… and logging Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
6e47f8f to
72aaf11
Compare
This closes #990.
Currently, when tracing guests, the max log level parameter provided to the guest is not used to filter out traces.
This PR adds the filtering capability for the guest tracing and also modifies some of the trace levels in the guest.
For that to work, a change in the
integration_tests.rswas necessary to update the number of expected logs inlog_messagetest