pub enum GuestLogFilter {
Off,
Error,
Warn,
Info,
Debug,
Trace,
}Expand description
This type is a unified definition of log level filters between the guest and host.
This is needed because currently the guest uses both the log and tracing crates,
and needs each type of LevelFilter from both crates.
To avoid as much as possible the amount of conversions between the two types, we define a
single type that can be converted to both log::LevelFilter and tracing_core::LevelFilter.
NOTE: This also takes care of the fact that the tracing and log enum types for the log
levels are not guaranteed to have the same discriminants, so we can’t just cast between them.
Variants§
Trait Implementations§
Source§impl Clone for GuestLogFilter
impl Clone for GuestLogFilter
Source§fn clone(&self) -> GuestLogFilter
fn clone(&self) -> GuestLogFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GuestLogFilter
impl Debug for GuestLogFilter
Source§impl From<GuestLogFilter> for LevelFilter
impl From<GuestLogFilter> for LevelFilter
Source§fn from(filter: GuestLogFilter) -> Self
fn from(filter: GuestLogFilter) -> Self
Source§impl From<GuestLogFilter> for LevelFilter
impl From<GuestLogFilter> for LevelFilter
Source§fn from(filter: GuestLogFilter) -> Self
fn from(filter: GuestLogFilter) -> Self
Source§impl From<GuestLogFilter> for u64
Used by the host to convert the GuestLogFilter to a u64 that is passed to the guest via
the C API.
impl From<GuestLogFilter> for u64
Used by the host to convert the GuestLogFilter to a u64 that is passed to the guest via
the C API.
Source§fn from(value: GuestLogFilter) -> Self
fn from(value: GuestLogFilter) -> Self
Source§impl From<LevelFilter> for GuestLogFilter
Used by the host to convert a tracing_core::LevelFilter to the intermediary GuestLogFilter
filter that is later converted to u64 and passed to the guest via the C API.
impl From<LevelFilter> for GuestLogFilter
Used by the host to convert a tracing_core::LevelFilter to the intermediary GuestLogFilter
filter that is later converted to u64 and passed to the guest via the C API.
Source§fn from(value: LevelFilter) -> Self
fn from(value: LevelFilter) -> Self
Source§impl PartialEq for GuestLogFilter
impl PartialEq for GuestLogFilter
Source§impl TryFrom<u64> for GuestLogFilter
Used by the guest to convert a u64 value passed from the host via the C API to the
intermediary GuestLogFilter filter that is later converted to both
tracing_core::LevelFilter and log::LevelFilter.
impl TryFrom<u64> for GuestLogFilter
Used by the guest to convert a u64 value passed from the host via the C API to the
intermediary GuestLogFilter filter that is later converted to both
tracing_core::LevelFilter and log::LevelFilter.