diff --git a/Cargo.lock b/Cargo.lock index 71ae698..5b4d464 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "aegisaur" -version = "0.1.0" +version = "2.0.0" dependencies = [ "anyhow", "chrono", diff --git a/src/ioc_fetcher.rs b/src/ioc_fetcher.rs index 7a8b1e1..7fd51a9 100644 --- a/src/ioc_fetcher.rs +++ b/src/ioc_fetcher.rs @@ -201,8 +201,15 @@ impl IocFetcher { let content = fs::read_to_string(&cache_file).await?; let iocs: Vec = serde_json::from_str(&content) .context("Konnte Cache nicht parsen")?; - debug!("{} IOCs aus Cache geladen (Alter: {}s)", iocs.len(), age.num_seconds()); + + let age_minutes = age.num_seconds() / 60; + let age_seconds = age.num_seconds() % 60; + + println!("📦 {} IOCs aus Cache (Alter: {}m {}s / TTL: 5m)", iocs.len(), age_minutes, age_seconds); + return Ok(iocs); + } else { + println!("⏰ Cache veraltet ({}m {}s alt) — Live-Reload...", age.num_seconds() / 60, age.num_seconds() % 60); } } diff --git a/src/main.rs b/src/main.rs index 9b9a589..ed6ea02 100644 --- a/src/main.rs +++ b/src/main.rs @@ -67,8 +67,15 @@ enum Commands { #[tokio::main] async fn main() -> Result<()> { // Logging initialisieren + // WICHTIG: Logs werden nur bei direkten Befehlen (nicht im Hook) angezeigt + if std::env::var("RUST_LOG").is_err() { + std::env::set_var("RUST_LOG", "info"); + } tracing_subscriber::fmt() - .with_env_filter("aegisaur=info") + .with_env_filter(tracing_subscriber::EnvFilter::from_default_env()) + .with_target(false) + .with_thread_ids(false) + .with_level(true) .init(); let cli = Cli::parse();