mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 20:43:41 +00:00
* Feat: Multi-lock capabilities add to config * wip: RPC.rs fixes, new combinatoric * wip: changes * chore: More things that are bulk * fix: Saving * chore: Remove a dyn object * chore: Add tests + remove unused * Fix/feat bulk locking (#1427) * fix: health check * fix: start/stop service * fix: install/uninstall services * chore: Fix the notifications * fix: Version * fix: Version as serde * chore: Update to latest patch db * chore: Change the htLock to something that makes more sense * chore: Fix the rest of the ht * "chore: More ht_lock":
38 lines
947 B
Rust
38 lines
947 B
Rust
use tracing::Subscriber;
|
|
use tracing_subscriber::util::SubscriberInitExt;
|
|
|
|
#[derive(Clone)]
|
|
pub struct EmbassyLogger {}
|
|
|
|
impl EmbassyLogger {
|
|
fn base_subscriber() -> impl Subscriber {
|
|
use tracing_error::ErrorLayer;
|
|
use tracing_subscriber::prelude::*;
|
|
use tracing_subscriber::{fmt, EnvFilter};
|
|
|
|
let filter_layer = EnvFilter::from_default_env();
|
|
let fmt_layer = fmt::layer().with_target(true);
|
|
|
|
tracing_subscriber::registry()
|
|
.with(filter_layer)
|
|
.with(fmt_layer)
|
|
.with(ErrorLayer::default())
|
|
}
|
|
pub fn init() -> Self {
|
|
Self::base_subscriber().init();
|
|
color_eyre::install().unwrap_or_else(|_| tracing::warn!("tracing too many times"));
|
|
|
|
EmbassyLogger {}
|
|
}
|
|
}
|
|
|
|
#[tokio::test]
|
|
pub async fn order_level() {
|
|
assert!(tracing::Level::WARN > tracing::Level::ERROR)
|
|
}
|
|
|
|
#[test]
|
|
pub fn module() {
|
|
println!("{}", module_path!())
|
|
}
|