pimalaya-tui 0.3.0

Collection of crossterm widgets shared accross Pimalaya projects
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::env;

use anyhow::Result;

use crate::terminal::tracing::Tracing;

pub fn install() -> Result<Tracing> {
    if env::var("RUST_LOG").is_err() {
        if std::env::args().any(|arg| arg == "--debug") {
            env::set_var("RUST_LOG", "debug");
        }
        if std::env::args().any(|arg| arg == "--trace") {
            env::set_var("RUST_LOG", "trace");
        }
    }

    Tracing::install()
}