summaryrefslogtreecommitdiff
path: root/src/lib.rs
blob: b26705409f56e8cc106b5aa647b03856eef8ef90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
pub mod cli;
pub mod core;
pub mod parsers;
pub mod formatters;
pub mod spdx;
pub mod cache;
pub mod gateway;
pub mod git;
pub mod error;

pub use core::*;
pub use error::{SpandxError, SpandxResult};

use std::sync::OnceLock;
use tracing::Level;

static AIRGAP_MODE: OnceLock<bool> = OnceLock::new();

pub fn set_airgap_mode(airgap: bool) {
    let _ = AIRGAP_MODE.set(airgap);
}

pub fn is_airgap_mode() -> bool {
    AIRGAP_MODE.get().copied().unwrap_or(false)
}

pub fn init_tracing() {
    tracing_subscriber::fmt()
        .with_max_level(Level::INFO)
        .with_target(false)
        .init();
}