Skip to content

Commit

Permalink
[core][tui] Clean up emoji use in logs, enhance tracing support
Browse files Browse the repository at this point in the history
  • Loading branch information
nazmulidris committed Dec 15, 2024
1 parent 504d4d4 commit 4cc1ab9
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 68 deletions.
53 changes: 0 additions & 53 deletions core/src/logging/console_log_impl.rs

This file was deleted.

2 changes: 0 additions & 2 deletions core/src/logging/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@

// Attach.
pub mod color_text_default_styles;
pub mod console_log_impl;
pub mod logging_api;
pub mod simple_file_logging_impl;

// Re-export.
pub use color_text_default_styles::*;
pub use console_log_impl::*;
pub use logging_api::*;
pub use simple_file_logging_impl::*;
4 changes: 2 additions & 2 deletions tui/examples/demo/ex_app_no_layout/app_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ mod app_main_impl_trait_app {
throws_with_return!({
call_if_true!(ENABLE_TRACE_EXAMPLES, {
tracing::info!(
" AppNoLayout::handle_event -> input_event: {input_event}"
"🎹 AppNoLayout::handle_event -> input_event: {input_event}"
);
});

Expand Down Expand Up @@ -534,7 +534,7 @@ mod status_bar {
pub fn create_status_bar_message(pipeline: &mut RenderPipeline, size: Size) {
let styled_texts = tui_styled_texts! {
tui_styled_text!{ @style: tui_style!(attrib: [dim]) , @text: "Hints:"},
tui_styled_text!{ @style: tui_style!(attrib: [bold]) , @text: " x : Exit "},
tui_styled_text!{ @style: tui_style!(attrib: [bold]) , @text: " x : Exit 🖖 "},
tui_styled_text!{ @style: tui_style!(attrib: [dim]) , @text: " … "},
tui_styled_text!{ @style: tui_style!(attrib: [underline]) , @text: " ↑ / + : inc "},
tui_styled_text!{ @style: tui_style!(attrib: [dim]) , @text: " … "},
Expand Down
2 changes: 1 addition & 1 deletion tui/examples/demo/ex_app_with_1col_layout/app_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ mod status_bar {
pub fn render_status_bar(pipeline: &mut RenderPipeline, size: Size) {
let styled_texts = tui_styled_texts! {
tui_styled_text! { @style: tui_style!(attrib: [dim]) , @text: "Hints:"},
tui_styled_text! { @style: tui_style!(attrib: [bold]) , @text: " x : Exit "},
tui_styled_text! { @style: tui_style!(attrib: [bold]) , @text: " x : Exit 🖖 "},
tui_styled_text! { @style: tui_style!(attrib: [dim]) , @text: " … "},
tui_styled_text! { @style: tui_style!(attrib: [underline]) , @text: " ↑ / + : inc "},
tui_styled_text! { @style: tui_style!(attrib: [dim]) , @text: " … "},
Expand Down
2 changes: 1 addition & 1 deletion tui/examples/demo/ex_app_with_2col_layout/app_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ mod status_bar {
pub fn render(pipeline: &mut RenderPipeline, size: Size) {
let styled_texts = tui_styled_texts! {
tui_styled_text! { @style: tui_style!(attrib: [dim]), @text: "Hints:" },
tui_styled_text! { @style: tui_style!(attrib: [bold]), @text: " x : Exit " },
tui_styled_text! { @style: tui_style!(attrib: [bold]), @text: " x : Exit 🖖 " },
tui_styled_text! { @style: tui_style!(attrib: [dim]), @text: " … " },
tui_styled_text! { @style: tui_style!(attrib: [underline]), @text: " ↑ / + : inc " },
tui_styled_text! { @style: tui_style!(attrib: [dim]), @text: " … " },
Expand Down
2 changes: 1 addition & 1 deletion tui/examples/demo/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Type a number to run corresponding example:
1. 📐 {}
2. 📐 {}
3. 🐒 {}
4. {}
4. 🦜 {}
5. 📔 {}
or type Ctrl+C, Ctrl+D, 'exit', or 'x' to exit",
Expand Down
2 changes: 1 addition & 1 deletion tui/src/tui/editor/editor_buffer/selection_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ mod format_debug_display {
};

if vec_output.is_empty() {
vec_output.push("✂️ ┆--empty--┆".to_string());
vec_output.push(" ┆--empty--┆".to_string());
}

vec_output.push(format!("🧭 prev_dir: {:?}", self.maybe_previous_direction,));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl OffscreenBufferPaint for OffscreenBufferPaintImplCrossterm {
// Debug output.
call_if_true!(DEBUG_TUI_SHOW_PIPELINE, {
tracing::info!(
"🎨 offscreen_buffer_paint_impl_crossterm::paint() ok : render_ops: \n{render_ops:?}",
"🎨 offscreen_buffer_paint_impl_crossterm::paint() ok 🟢: render_ops: \n{render_ops:?}",
);
});
}
Expand Down Expand Up @@ -100,7 +100,7 @@ impl OffscreenBufferPaint for OffscreenBufferPaintImplCrossterm {
// Debug output.
call_if_true!(DEBUG_TUI_SHOW_PIPELINE, {
tracing::info!(
"🎨 offscreen_buffer_paint_impl_crossterm::paint() ok : render_ops: \n{render_ops:?}"
"🎨 offscreen_buffer_paint_impl_crossterm::paint() ok 🟢: render_ops: \n{render_ops:?}"
);
});
}
Expand Down Expand Up @@ -197,7 +197,7 @@ impl OffscreenBufferPaint for OffscreenBufferPaintImplCrossterm {
fn render_diff(&mut self, diff_chunks: &PixelCharDiffChunks) -> RenderOps {
call_if_true!(DEBUG_TUI_COMPOSITOR, {
tracing::info!(
"🎨 offscreen_buffer_paint_impl_crossterm::render_diff() ok : \ndiff_chunks: \n{}",
"🎨 offscreen_buffer_paint_impl_crossterm::render_diff() ok 🟢: \ndiff_chunks: \n{}",
diff_chunks.pretty_print()
);
});
Expand Down
8 changes: 4 additions & 4 deletions tui/src/tui/terminal_window/main_event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ where

call_if_true!(DEBUG_TUI_MOD, {
if let InputEvent::Keyboard(_)= input_event {
tracing::info!("main_event_loop -> Tick: {input_event}");
tracing::info!("main_event_loop -> Tick: 🌄 {input_event}");
}
});

Expand Down Expand Up @@ -404,9 +404,9 @@ where
call_if_true!(DEBUG_TUI_MOD, {
{
let state = &global_data.state;
tracing::info!("🎨 MySubscriber::paint() ok : \n window_size: {window_size:?}\n state: {state:?}");
tracing::info!("🎨 MySubscriber::paint() ok 🟢: \n window_size: {window_size:?}\n state: {state:?}");
tracing::info!(
"🌍⏳ SPEED: {:?}",
"🏁 SPEED: {:?}",
telemetry_global_static::get_avg_response_time_micros(),
);

Expand Down Expand Up @@ -905,7 +905,7 @@ mod tests {
pub fn create_status_bar_message(pipeline: &mut RenderPipeline, size: Size) {
let styled_texts = tui_styled_texts! {
tui_styled_text!{ @style: tui_style!(attrib: [dim]) , @text: "Hints:"},
tui_styled_text!{ @style: tui_style!(attrib: [bold]) , @text: " x : Exit "},
tui_styled_text!{ @style: tui_style!(attrib: [bold]) , @text: " x : Exit 🖖 "},
tui_styled_text!{ @style: tui_style!(attrib: [dim]) , @text: " … "},
tui_styled_text!{ @style: tui_style!(attrib: [underline]) , @text: " ↑ / + : inc "},
tui_styled_text!{ @style: tui_style!(attrib: [dim]) , @text: " … "},
Expand Down

0 comments on commit 4cc1ab9

Please sign in to comment.