soundview 0.3.0

Live analyzer/voiceprint visualization of system audio
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use tracing;
use tracing_subscriber::EnvFilter;

/// Sets up logging, checks for a LOG_LEVEL envvar.
pub fn init_logging() {
    let filter_layer = EnvFilter::try_from_env("LOG_LEVEL")
        .or_else(|_| EnvFilter::try_new("info"))
        .expect("Failed to initialize filter layer");

    tracing::subscriber::set_global_default(
        tracing_subscriber::fmt()
            .with_writer(std::io::stderr)
            .with_env_filter(filter_layer)
            .finish(),
    )
    .expect("Failed to set default subscriber");
}