free_log_client 0.5.0

Free logging library Rust client
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::sync::{Arc, LazyLock};

use tokio::{fs::File, io::BufWriter};

use crate::Level;

pub(crate) type FileWriters = Arc<tokio::sync::Mutex<Option<Vec<(Level, BufWriter<File>)>>>>;

pub(crate) static CLIENT: LazyLock<reqwest::Client> = LazyLock::new(reqwest::Client::new);

pub(crate) static RT: LazyLock<tokio::runtime::Runtime> = LazyLock::new(|| {
    tokio::runtime::Builder::new_multi_thread()
        .enable_all()
        .max_blocking_threads(1)
        .build()
        .unwrap()
});