diff --git a/Cargo.toml b/Cargo.toml index b9aed4e..d5de8ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,8 +19,8 @@ name = "rlt" path = "src/lib.rs" [features] -default = ["log", "rate_limit", "http"] -log = ["dep:log", "dep:tracing", "dep:tui-logger"] +default = ["tracing", "rate_limit", "http"] +tracing = ["dep:log", "dep:tracing", "dep:tui-logger"] rate_limit = ["dep:governor"] http = ["dep:http"] diff --git a/src/collector/tui.rs b/src/collector/tui.rs index 488bc6a..0495120 100644 --- a/src/collector/tui.rs +++ b/src/collector/tui.rs @@ -57,7 +57,7 @@ pub struct TuiCollector { struct TuiCollectorState { tm_win: TimeWindow, finished: bool, - #[cfg(feature = "log")] + #[cfg(feature = "tracing")] log: tui_log::LogState, } @@ -74,7 +74,7 @@ impl TuiCollector { let state = TuiCollectorState { tm_win: TimeWindow::Second, finished: false, - #[cfg(feature = "log")] + #[cfg(feature = "tracing")] log: tui_log::LogState::from_env()?, }; Ok(Self { bench_opts, fps, res_rx, pause, cancel, auto_quit, state }) @@ -236,7 +236,7 @@ impl TuiCollector { render_latency_hist(f, bot[1], hist, 7); render_tips(f, rows[4]); - #[cfg(feature = "log")] + #[cfg(feature = "tracing")] tui_log::render_logs(f, &self.state.log); })?; } @@ -274,9 +274,9 @@ impl TuiCollector { } self.pause.send_replace(pause); } - #[cfg(feature = "log")] + #[cfg(feature = "tracing")] (Char('l'), _) => self.state.log.display = !self.state.log.display, - #[cfg(feature = "log")] + #[cfg(feature = "tracing")] (code, _) if self.state.log.display => { use tui_logger::TuiWidgetEvent::*; let mut txn = |e| self.state.log.inner.transition(e); @@ -583,7 +583,7 @@ fn render_tips(frame: &mut Frame, area: Rect) { let tips = gen_tips([ ("+/-", "Zoom in/out"), ("a", "Auto time window"), - #[cfg(feature = "log")] + #[cfg(feature = "tracing")] ("l", "Logs window"), ("p", "Pause"), ("q", "Quit"), @@ -648,7 +648,7 @@ impl TimeWindow { } } -#[cfg(feature = "log")] +#[cfg(feature = "tracing")] mod tui_log { use super::*; diff --git a/src/lib.rs b/src/lib.rs index b7187b7..7fbb3f5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -73,5 +73,5 @@ pub use crate::{ status::{Status, StatusKind}, }; -#[cfg(feature = "log")] +#[cfg(feature = "tracing")] pub use tui_logger::tracing_subscriber_layer as tui_tracing_subscriber_layer; diff --git a/src/runner.rs b/src/runner.rs index 2235886..7680b01 100644 --- a/src/runner.rs +++ b/src/runner.rs @@ -151,7 +151,7 @@ where self.wait_if_paused().await; let res = self.suite.bench(state, info).await; - #[cfg(feature = "log")] + #[cfg(feature = "tracing")] if let Err(e) = &res { log::error!("Error in iteration({info:?}): {:?}", e); }