memonitor 0.2.4

Query CPU and GPU memory information in a portable way.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use tracing_subscriber::filter::LevelFilter;
use tracing_subscriber::{fmt, EnvFilter};

pub fn init_tracing() {
    let format = fmt::format()
        .with_target(true)
        .with_source_location(false)
        .with_thread_names(true)
        .compact();
    let filter = EnvFilter::try_from_default_env()
        .unwrap_or(EnvFilter::default().add_directive(LevelFilter::TRACE.into()));
    fmt().event_format(format).with_env_filter(filter).init();
}