Even though its an old post, this may be helpful for other people stumbling upon this post.
I had exactly the same issue, in my case the errors could not even be printed to screen anymore as they were too long. So I dumped them into a text file and tried some basic search using a text editor rather than grep'ing through the file, some of which could be as large as 20 MB (not bad for just errors). Most errors would be duplicated, as I compiled in parallel, so that was another huge problem.
As I was getting tired with that approach (and also it was not very productive), I developed a small helper program which I could chain in directly into my compiler toolchain, so that any output generated by the compiler could be formatted based on some rules defined in a json file. The program can be found here: https://github.com/tomrobin-teschner/dotify
There are three basic functionalities:
- Don't print current output (line) from compiler if it contains a certain string
- Only print a certain line if it contains a keyword (which can be colorised)
- If there is a template involved, remove the content between the <> brackets and replace them by dots. So for example,
MyClass<std::vector<double>, std::array<double, 3>>
would be simply replaced by MyClass<...>
.
The full error message is still stored inside a log file (and can be later used if more detailed information are required), the parser only works on the output which is printed to the console.
The command to invoke the parser is
/path/to/program | tee log | /path/to/parser -f /path/to/inputFile.json
/path/to/program
is the program to execute (and from which the output should be formatted)
/path/to/parser -f /path/to/inputFile.json
, location of the parser, the -f flags specifies the input file (in json format), which, for a very simple case could look like this:
{
"ignoreCompleteLineIfItContainsSubstring" : [
"should be suppressed"
],
"ignoreContentBetweenDelimiter" : [
{
"startingDelimiter" : "<",
"endingDelimiter" : ">",
"replaceContentBy" : "..."
}
],
"styleLineContainingKeywords" : [
{
"keyword" : "error",
"removeDuplicates" : true,
"applyStyle" : "onKeyword",
"color" : "red",
"style" : "bold"
}
]
}
A full list of options and explanations can be found on the project site (https://github.com/tomrobin-teschner/dotify)