Log Problem MatcherLog Problem Matcher (LPM) scans a log file and outputs any errors, warnings, or infos found to the VS Code Problems pane. You define a regular expression to match the issues you want to extract from the log file and tell LPM what type of data you've captured with the regex. Then LPM scans your log and populates the Problems pane. The setup for LPM is similar to the problem matcher used in VS Code Tasks. You can configure multiple "parsers", each targeted at a different type of log file. Each parser can have multiple matchers in case you need multiple regular expressions to capture the different types of problems. Commands
Extension SettingsLPM contributes the following settings:
The "parsers" setting is an object where the keys are the names of your different parsers. For example, you may have a parser set up for logs that come from a particular program. Each named parser contains an array of problem matchers. These problem matchers are defined in the same way as problem matchers for VS Code tasks, with a couple minor differences. The biggest limitation is that LPM doesn't yet support multi-line problem matchers. One addition to the standard problem matchers is that LPM contains three optional keys in the "pattern" which allow for more flexibility in detecting different types of problems: error_string, warning_string, and info_string. While VS Code's task problem matchers only detect the different types of problems with the default strings "error", "warning", and "info", LPM allows you to define your own indicators. For example, if your log file indicates and error with "ER: Message", you could set the "error_string" to "ER". Then when your regex matches "ER" in the severity group, LPM will automatically detect it as an error. The custom indicator properties accept a single string or an array of strings in case your log is particularly crazy and uses multiple styles. Problem Matcher PropertiesParsers have the following optional properties which are different from standard task problem matchers:
Problem matchers (the array elements inside a Parser) have the following optional properties which are different from standard task problem matchers:
LPM does not include the following properties present in standard task problem matchers:
Sample ConfigurationThe below image shows a sample configuration for a Parser. This Parser, named "gcc_log", has two matchers: one for catching errors and warnings and another for notes and infos. Note that this isn't really a valid matcher for gcc, just an example. The regular expressions in this sample might match lines that look like this:
Known Issues
Release Notes1.0.0Initial release of Log Problem Matcher. |