Struct fluence::WasmLoggerBuilder [−][src]
pub struct WasmLoggerBuilder { /* fields omitted */ }
The Wasm logger builder.
Build logger for the Fluence network, allows specifying target map and log level while building.
Implementations
impl WasmLoggerBuilder
[src]
impl WasmLoggerBuilder
[src]pub fn new() -> WasmLoggerBuilder
[src]
pub fn new() -> WasmLoggerBuilder
[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) -> WasmLoggerBuilder
[src]
pub fn with_log_level(self, level: LevelFilter) -> WasmLoggerBuilder
[src]Set the log level.
pub fn with_target_map(
self,
map: HashMap<&'static str, i32, RandomState>
) -> WasmLoggerBuilder
[src]
pub fn with_target_map(
self,
map: HashMap<&'static str, i32, RandomState>
) -> WasmLoggerBuilder
[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
) -> WasmLoggerBuilder
[src]
self,
module_name: impl Into<String>,
level: LevelFilter
) -> WasmLoggerBuilder
pub fn build(self) -> Result<(), SetLoggerError>
[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();