adb_cli 2.1.18

Rust ADB (Android Debug Bridge) CLI
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// # Safety
///
/// This conditionally mutates the process' environment.
/// See [`std::env::set_var`] for more info.
pub unsafe fn setup_logger(debug: bool) {
    // RUST_LOG variable has more priority then "--debug" flag
    if std::env::var("RUST_LOG").is_err() {
        let level = if debug { "trace" } else { "info" };

        unsafe { std::env::set_var("RUST_LOG", level) };
    }

    env_logger::init();
}