Struct fluence_sdk_main::WasmLoggerBuilder[][src]

pub struct WasmLoggerBuilder { /* fields omitted */ }
Expand description

The Wasm logger builder.

Build logger for the Fluence network, allows specifying target map and log level while building.

Implementations

impl WasmLoggerBuilder[src]

pub fn new() -> Self[src]

Initializes a builder of the global logger. Set log level based on the WASM_LOG environment variable if it set, or [[WASM_DEFAULT_LOG_LEVEL]] otherwise. It is an initial method in this builder chain, please note, that logger wouldn’t work without subsequent build() call.

pub fn with_log_level(self, level: LevelFilter) -> Self[src]

Set the log level.

pub fn with_target_map(self, map: TargetMap) -> Self[src]

Set mapping between logging targets and numbers. Used to efficiently enable & disable logs per target on the host.

pub fn filter(self, module_name: impl Into<String>, level: LevelFilter) -> Self[src]

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

Build the real logger.

This method is a last one in this builder chain and MUST be called to set logger up. Returns a error

    logger::WasmLoggerBuilder::new()
        .with_log_level(log::LevelFilter::Trace)
        .with_target_map(<_>::default())
        .build()
        .unwrap();

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.