use std::sync::{Mutex, Once};
use lazy_static::lazy_static;
pub use crate::subscriber::{get_subscriber, MockWriter};
pub static INITIALIZED: Once = Once::new();
lazy_static! {
#[doc(hidden)]
pub static ref GLOBAL_BUF: Mutex<Vec<u8>> = Mutex::new(vec![]);
}
pub fn logs_with_scope_contain(scope: &str, val: &str) -> bool {
let logs = String::from_utf8(GLOBAL_BUF.lock().unwrap().to_vec()).unwrap();
for line in logs.split('\n') {
if line.contains(&format!(" {}:", scope)) && line.contains(val) {
return true;
}
}
false
}