[][src]Struct fluence_sdk_main::WasmLogger

pub struct WasmLogger { /* fields omitted */ }

The Wasm Logger.

This struct implements the Log trait from the log crate, which allows it to act as a logger.

For initialization of WasmLogger as a default logger please see init() and init_with_level()

Implementations

impl WasmLogger[src]

pub fn init_with_level(level: Level) -> Result<(), SetLoggerError>[src]

Initializes the global logger with a WasmLogger instance, sets max_log_level to a given log level.

if cfg!(target_arch = "wasm32") {
    logger::WasmLogger::init_with_level(log::Level::Error).unwrap();
}
error!("This message will be logged.");
info!("This message will not be logged.");

pub fn init() -> Result<(), SetLoggerError>[src]

Initializes the global logger with a WasmLogger instance, sets max_log_level to Level::Info.

if cfg!(target_arch = "wasm32") {
    fluence::logger::WasmLogger::init().unwrap();
}

error!("This message will be logged.");
trace!("This message will not be logged.");

Trait Implementations

impl Log for WasmLogger[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.