pub struct HostLogger;Expand description
Logger implementation that forwards records to the host.
This integrates the Rust log crate with the http-wasm guest runtime’s logging system.
It provides logging for plugin authors via standard macros (log::info!, log::warn!, etc.).
Implementations§
Source§impl HostLogger
impl HostLogger
Sourcepub fn init() -> Result<(), SetLoggerError>
pub fn init() -> Result<(), SetLoggerError>
Initialize the host-backed logger with the default Info level.
This is a convenience function for [init_with_level] using Level::Info.
Sourcepub fn init_with_level(level: Level) -> Result<(), SetLoggerError>
pub fn init_with_level(level: Level) -> Result<(), SetLoggerError>
Initialize the host-backed logger with a specific maximum level.
This registers a HostLogger implementation for forwarding log records to the http-wasm host.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HostLogger
impl RefUnwindSafe for HostLogger
impl Send for HostLogger
impl Sync for HostLogger
impl Unpin for HostLogger
impl UnsafeUnpin for HostLogger
impl UnwindSafe for HostLogger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more