Skip to content

Commit 22ef8b0

Browse files
committed
feat: use hex formatted ids in telemetry-ui
Signed-off-by: Wim Looman <[email protected]>
1 parent 3333822 commit 22ef8b0

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

veecle-telemetry-ui/src/store/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ use web_time::Instant;
2323
#[derive(Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
2424
pub struct LogId(usize);
2525

26+
impl std::fmt::Display for LogId {
27+
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
28+
let Self(id) = self;
29+
write!(f, "{id:05x}")
30+
}
31+
}
32+
2633
impl From<usize> for LogId {
2734
fn from(value: usize) -> Self {
2835
LogId(value)

veecle-telemetry-ui/src/ui/selection_panel.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn selection_content_ui(
5050
panel_content_ui(ui, |ui| {
5151
ui.horizontal(|ui| {
5252
ui.strong("Span");
53-
ui.monospace(format!("{span_id:?}"));
53+
ui.monospace(format!("{span_id}"));
5454
});
5555
});
5656

@@ -70,7 +70,7 @@ fn selection_content_ui(
7070
panel_content_ui(ui, |ui| {
7171
ui.horizontal(|ui| {
7272
ui.strong("Log");
73-
ui.monospace(format!("{log_id:?}"));
73+
ui.monospace(format!("{log_id}"));
7474
});
7575
});
7676

@@ -224,9 +224,9 @@ fn optional_label_ui(ui: &mut egui::Ui, value: Option<impl std::fmt::Display>) {
224224

225225
fn reference_link_ui<T>(ui: &mut egui::Ui, selection_state: &SelectionState, item: T)
226226
where
227-
T: Into<Item> + std::fmt::Debug,
227+
T: Into<Item> + std::fmt::Display,
228228
{
229-
let text = egui::RichText::new(format!("{item:?}")).monospace();
229+
let text = egui::RichText::new(format!("{item}")).monospace();
230230
let response = ui.link(text);
231231

232232
let item = item.into();

veecle-telemetry-ui/src/ui/timeline/traces.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ fn paint_scope_details(ui: &mut egui::Ui, span: SpanRef, max: Timestamp) {
290290
.num_columns(2)
291291
.show(ui, |ui| {
292292
ui.monospace("id");
293-
ui.monospace(format!("{:?}", span.context));
293+
ui.monospace(format!("{}", span.context));
294294
ui.end_row();
295295

296296
ui.monospace("operation name");

0 commit comments

Comments
 (0)