Skip to content

Watch Patterns

Watch patterns let you define text or regex patterns that LogScope matches against every incoming log line. When a line matches, it gets a colored dot marker in the log viewer.

This gives you instant visibility into recurring events, errors, or state changes without scrolling through thousands of lines.

Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run LogScope: Add Watch Pattern. You’ll see a list of curated presets plus a custom option:

PresetPatternType
Errorsfailed|error|fault|CRC|timeoutRegex
Warningsthreshold|exceeded|critical|low|driftRegex
RetransmissionRetransmissionSubstring
BLE StateConnected|Disconnected|AdvertisingRegex
HeartbeatHeartbeatSubstring

Select a preset to add it instantly. Presets you’ve already added are automatically hidden.

Select Custom pattern… to define your own with the interactive flow: name, pattern text, match type (substring or regex), and optional module scope.

Add patterns directly in your settings.json (see the settings reference for all watch pattern fields):

"logscope.watchPatterns": [
{
"name": "Errors",
"pattern": "failed|error|fault|CRC|timeout",
"regex": true,
"color": "#f44336"
},
{
"name": "Retransmission",
"pattern": "Retransmission",
"color": "#ff9800"
},
{
"name": "Crypto Only",
"pattern": "failed",
"module": "crypto_mgr",
"color": "#9c27b0"
}
]
FieldRequiredDescription
nameYesDisplay label shown in the dot tooltip
patternYesText to match. Case-insensitive.
regexNoSet true to treat pattern as a regular expression. Default: false (substring match).
moduleNoOnly match log entries from this module (case-insensitive). Omit to match all modules.
colorNoHex color for the marker dot (e.g., #ff9800). Auto-assigned from a palette if omitted.

When a log line matches a watch pattern, a small colored dot appears at the beginning of the row. If a line matches multiple patterns, multiple dots appear.

Hover over a dot to see the pattern name in the tooltip.

Watch patterns reload immediately when you change them in settings. You don’t need to reconnect. New patterns start matching from the next incoming log line (they don’t retroactively match existing lines).

  • From the Command Palette: Run LogScope: Remove Watch Pattern and select the pattern to remove.
  • From settings: Remove the entry from the logscope.watchPatterns array in settings.json.
  • Use regex for multiple terms: failed|error|timeout matches any of those words
  • Scope to a module when the same keyword appears in multiple modules but you only care about one
  • Auto-assigned colors work well. You don’t need to pick colors unless you want specific ones.
  • Watch patterns work in all parser modes (Zephyr, nRF5 SDK, Raw)