wasm-startup 0.1.6

A simple WASM startup project
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use tracing::Level;

pub fn log(is_debug: bool) {
    let filter = if is_debug { Level::TRACE } else { Level::INFO };
    // 根据debug 模式设置日志格式
    tracing_subscriber::fmt().pretty()
        .without_time()
        .with_file(is_debug)
        .with_line_number(is_debug)
        .with_target(is_debug)
        .with_max_level(filter)
        .init();
}