EWIDT Display Format in tui-logger: Interpreting the Target Selector
EWIDT is a five-letter acronym representing log levels (Error, Warn, Info, Debug, Trace) displayed in the tui-logger target selector, where each letter's visual style indicates whether that level is captured, shown, or disabled for a specific logging target.
The tui-logger crate provides a terminal user interface widget for Rust applications to monitor and filter log output in real time. Understanding the EWIDT display format in the target selector is essential for effectively controlling which log levels are recorded and displayed for each module or target.
What EWIDT Represents
According to the crate documentation in src/lib.rs, EWIDT is a mnemonic for the five standard log levels. Each letter corresponds to a specific severity level, displayed side-by-side for every logging target in the selector column:
- E –
Error - W –
Warn - I –
Info - D –
Debug - T –
Trace
These symbols appear in the target selector widget as E W I D T : <target-name>.
How the EWIDT Column Renders
The visualization logic resides in src/widget/target.rs. The widget draws each letter according to two independent filter states managed by the logger:
- hot_level_filter: Determines which levels are captured (recorded in the hot buffer)
- level_filter: Determines which levels are shown (visible in the log pane)
Visual State Interpretation
The rendering algorithm in src/widget/target.rs applies three distinct visual states to each EWIDT letter:
- Captured and Shown: Rendered with
style_show, typically usingModifier::REVERSED(inverted colors) when the target has focus - Captured but Hidden: Rendered with
style_hide(normal colors, not reversed) - Disabled: Blank space or
style_offstyling when the level is below the capture threshold
The core rendering logic maps symbols to levels and applies conditional styling:
for (j, sym, lev) in &[
(0, "E", Level::Error),
(1, "W", Level::Warn),
(2, "I", Level::Info),
(3, "D", Level::Debug),
(4, "T", Level::Trace),
] {
let cell_style = if hot_level_filter >= *lev {
// captured
if level_filter >= *lev {
// shown
if !focus_selected || i + offset == state.selected {
self.style_show // highlighted when focused
} else {
self.style_hide // normal when not focused
}
} else {
self.style_hide // captured but not shown
}
} else if let Some(style_off) = self.style_off {
style_off // level off
} else {
cell.set_symbol(" "); continue;
};
cell.set_style(cell_style);
cell.set_symbol(sym);
}
Interpreting EWIDT States
When examining the target selector, observe these visual patterns to understand the current filter configuration:
- All five letters in normal style: The target captures all levels, but none are currently shown in the log view, or the target lacks focus.
- Reversed/highlighted letters: These levels are both captured and actively displayed. The reversal indicates the target has focus and the level meets the
level_filter. - Blank positions: The level is completely disabled (below
hot_level_filter) and nostyle_offis configured.
Practical Example
Consider a target displaying:
E W I T : demo
- E, W, and I appear in normal style: These levels are captured but not displayed in the log pane.
- T appears reversed: This level is both captured and displayed (active focus).
- The blank space at D position: Debug logging is disabled for this target.
Controlling EWIDT with Keyboard Shortcuts
Modify the EWIDT display in real time using these key bindings:
- + / -: Increase or decrease the captured level (modifies
hot_level_filter) - RIGHT / LEFT: Increase or decrease the shown level (modifies
level_filter)
Pressing LEFT reduces the shown level, causing the rightmost active letter to revert from reversed to normal style. Pressing - reduces the captured level, potentially replacing letters with blanks or style_off indicators.
Summary
- EWIDT stands for Error, Warn, Info, Debug, and Trace as defined in
src/lib.rs - The rendering engine in
src/widget/target.rsdistinguishes between captured, shown, and disabled states usingstyle_show,style_hide, andstyle_off - Reversed letters indicate levels currently displayed when the target is focused
- Use
+/-keys to adjust capture levels and arrow keys to control which captured levels appear in the log view
Frequently Asked Questions
What do the letters in EWIDT stand for?
Each letter represents a log severity level: E for Error, W for Warn, I for Info, D for Debug, and T for Trace. These correspond to the standard levels defined in the Rust log crate and appear in the target selector as documented in src/lib.rs.
Why do some EWIDT letters appear reversed or highlighted?
Reversed or highlighted letters indicate log levels that are both captured (recorded in the hot buffer) and shown (displayed in the log pane). The Modifier::REVERSED style is applied in src/widget/target.rs when a level meets the level_filter criteria and the target has focus.
What does it mean when an EWIDT position is blank?
A blank space in the EWIDT column indicates that the corresponding log level is disabled for that target. This occurs when the level is below the hot_level_filter threshold and no style_off is configured in the widget settings.
How do I change which EWIDT levels are displayed?
Use the RIGHT and LEFT arrow keys to increase or decrease the shown level filter, and + or - to adjust the captured level filter. These actions modify the level_filter and hot_level_filter values respectively, updating the EWIDT display in real time according to the logic in src/widget/target.rs.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →