diff --git a/docsSite/docs/tab-reference/console.md b/docsSite/docs/tab-reference/console.md index 7443b1fc..1c8d4d56 100644 --- a/docsSite/docs/tab-reference/console.md +++ b/docsSite/docs/tab-reference/console.md @@ -15,8 +15,12 @@ Drag the desired field to the main view to get started. Each row represents an u ![Console view](./img/console-1.png) -The controls are similar to the 🔢 [Table](../tab-reference/table.md) tab. The selected time is synchronized across all tabs. Click a row to select it, or hover over a row to preview it in any visible pop-up windows. Clicking the ↓ button jumps to the selected time (or the time entered in the box). Enter text in the "Filter" input to only display rows which contain the filter text. Press **Ctrl+F** to quickly select the "Filter" input. - :::tip Click the color palette icon to toggle highlighting for warning and error messages. Messages are highlighted if they contain the text "warning" or "error". ::: + +The controls are similar to the 🔢 [Table](../tab-reference/table.md) tab. The selected time is synchronized across all tabs. Click a row to select it, or hover over a row to preview it in any visible pop-up windows. Clicking the ↓ button jumps to the selected time (or the time entered in the box). Enter text in the "Filter" input to only display rows which contain the filter text. Press **Ctrl+F** to quickly select the "Filter" input. + +:::info +Adding a "!" at the start of the filter text will _exclude_ matching messages from the main view. +::: diff --git a/src/shared/renderers/ConsoleRenderer.ts b/src/shared/renderers/ConsoleRenderer.ts index 6b2c9334..ab4981e0 100644 --- a/src/shared/renderers/ConsoleRenderer.ts +++ b/src/shared/renderers/ConsoleRenderer.ts @@ -190,12 +190,16 @@ export default class ConsoleRenderer implements TabRenderer { let timestamps = this.timestamps; let values = this.values; const filter = this.FILTER_INPUT.value.toLowerCase(); - if (filter.length > 0) { + if (filter.startsWith("!") ? filter.length > 1 : filter.length > 0) { let filteredTimestamps: number[] = []; let filteredValues: string[] = []; for (let i = 0; i < timestamps.length; i++) { let value = values[i]; - if (value.toLowerCase().includes(filter)) { + if ( + filter.startsWith("!") + ? !value.toLowerCase().includes(filter.slice(1).toLowerCase()) + : value.toLowerCase().includes(filter.toLowerCase()) + ) { filteredTimestamps.push(timestamps[i]); filteredValues.push(value); } @@ -239,7 +243,7 @@ export default class ConsoleRenderer implements TabRenderer { for (let i = 0; i < values.length; i++) { // Format value let valueFormatted = ""; - if (filter.length > 0) { + if (filter.length > 0 && !filter.startsWith("!")) { let lastPosition = -1; let position = -1; while (