Skip to content

Commit 9f40255

Browse files
committed
refactor: rename log feature to tracing
Signed-off-by: Wenxuan Zhang <[email protected]>
1 parent 7c78f9d commit 9f40255

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ name = "rlt"
1919
path = "src/lib.rs"
2020

2121
[features]
22-
default = ["log", "rate_limit", "http"]
23-
log = ["dep:log", "dep:tracing", "dep:tui-logger"]
22+
default = ["tracing", "rate_limit", "http"]
23+
tracing = ["dep:log", "dep:tracing", "dep:tui-logger"]
2424
rate_limit = ["dep:governor"]
2525
http = ["dep:http"]
2626

src/collector/tui.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub struct TuiCollector {
5757
struct TuiCollectorState {
5858
tm_win: TimeWindow,
5959
finished: bool,
60-
#[cfg(feature = "log")]
60+
#[cfg(feature = "tracing")]
6161
log: tui_log::LogState,
6262
}
6363

@@ -74,7 +74,7 @@ impl TuiCollector {
7474
let state = TuiCollectorState {
7575
tm_win: TimeWindow::Second,
7676
finished: false,
77-
#[cfg(feature = "log")]
77+
#[cfg(feature = "tracing")]
7878
log: tui_log::LogState::from_env()?,
7979
};
8080
Ok(Self { bench_opts, fps, res_rx, pause, cancel, auto_quit, state })
@@ -236,7 +236,7 @@ impl TuiCollector {
236236
render_latency_hist(f, bot[1], hist, 7);
237237
render_tips(f, rows[4]);
238238

239-
#[cfg(feature = "log")]
239+
#[cfg(feature = "tracing")]
240240
tui_log::render_logs(f, &self.state.log);
241241
})?;
242242
}
@@ -274,9 +274,9 @@ impl TuiCollector {
274274
}
275275
self.pause.send_replace(pause);
276276
}
277-
#[cfg(feature = "log")]
277+
#[cfg(feature = "tracing")]
278278
(Char('l'), _) => self.state.log.display = !self.state.log.display,
279-
#[cfg(feature = "log")]
279+
#[cfg(feature = "tracing")]
280280
(code, _) if self.state.log.display => {
281281
use tui_logger::TuiWidgetEvent::*;
282282
let mut txn = |e| self.state.log.inner.transition(e);
@@ -583,7 +583,7 @@ fn render_tips(frame: &mut Frame, area: Rect) {
583583
let tips = gen_tips([
584584
("+/-", "Zoom in/out"),
585585
("a", "Auto time window"),
586-
#[cfg(feature = "log")]
586+
#[cfg(feature = "tracing")]
587587
("l", "Logs window"),
588588
("p", "Pause"),
589589
("q", "Quit"),
@@ -648,7 +648,7 @@ impl TimeWindow {
648648
}
649649
}
650650

651-
#[cfg(feature = "log")]
651+
#[cfg(feature = "tracing")]
652652
mod tui_log {
653653
use super::*;
654654

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ pub use crate::{
7373
status::{Status, StatusKind},
7474
};
7575

76-
#[cfg(feature = "log")]
76+
#[cfg(feature = "tracing")]
7777
pub use tui_logger::tracing_subscriber_layer as tui_tracing_subscriber_layer;

src/runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ where
151151
self.wait_if_paused().await;
152152
let res = self.suite.bench(state, info).await;
153153

154-
#[cfg(feature = "log")]
154+
#[cfg(feature = "tracing")]
155155
if let Err(e) = &res {
156156
log::error!("Error in iteration({info:?}): {:?}", e);
157157
}

0 commit comments

Comments
 (0)