summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorToby Vincent <tobyv@tobyvin.dev>2024-10-01 13:15:24 -0500
committerToby Vincent <tobyv@tobyvin.dev>2024-10-01 13:15:24 -0500
commitfe16a923190243dfde5db6ceff2ef0bcf9158926 (patch)
tree9b8b616e1972ca3ef6e28d29c980899af3ddde49 /src/main.rs
parente1d9c956beb6921b0d549248bea3a6853fde5f46 (diff)
feat: simplify service status type
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/main.rs b/src/main.rs
index 99af338..fbf27cb 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,7 +1,7 @@
use std::{collections::HashMap, fs::File, path::PathBuf, sync::Arc};
use tower_http::services::ServeDir;
use tracing::level_filters::LevelFilter;
-use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
+use tracing_subscriber::EnvFilter;
use statsrv::service::Service;
@@ -12,14 +12,10 @@ const DEFAULT_CONFIG: &str = "./config.toml";
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
- tracing_subscriber::registry()
- .with(
- EnvFilter::builder()
- .with_default_directive(LevelFilter::INFO.into())
- .from_env_lossy(),
- )
- .with(tracing_subscriber::fmt::layer())
- .init();
+ let filter = EnvFilter::builder()
+ .with_default_directive(LevelFilter::INFO.into())
+ .from_env_lossy();
+ tracing_subscriber::fmt().with_env_filter(filter).init();
let config = match Config::parse() {
Ok(c) => c,