|
|
|
@ -1,8 +1,10 @@ |
|
|
|
|
#include <iostream> |
|
|
|
|
#include <fstream> |
|
|
|
|
#include <fmt/core.h> |
|
|
|
|
#include <regex> |
|
|
|
|
#include <string> |
|
|
|
|
#include <iterator> |
|
|
|
|
#include <ctime> |
|
|
|
|
|
|
|
|
|
using namespace std; |
|
|
|
|
using namespace fmt; |
|
|
|
@ -11,21 +13,26 @@ int main() |
|
|
|
|
{ |
|
|
|
|
regex err_re("(.*?):([0-9]+):([0-9]+):\\s*(.*?):\\s*(.*)"); |
|
|
|
|
string line; |
|
|
|
|
smatch err_match; |
|
|
|
|
smatch err; |
|
|
|
|
ofstream stats_out; |
|
|
|
|
stats_out.open("stats.csv", ios::out | ios::app); |
|
|
|
|
auto t = time(nullptr); |
|
|
|
|
auto tm = *std::gmtime(&t); |
|
|
|
|
|
|
|
|
|
while(getline(cin, line)) { |
|
|
|
|
print("{}\n", line); |
|
|
|
|
if(regex_match(line, err_match, err_re)) { |
|
|
|
|
string file_name = err_match[1].str(); |
|
|
|
|
string line = err_match[2].str(); |
|
|
|
|
string col = err_match[3].str(); |
|
|
|
|
string type = err_match[4].str(); |
|
|
|
|
string message = err_match[5].str(); |
|
|
|
|
if(regex_match(line, err, err_re)) { |
|
|
|
|
string file_name = err[1].str(); |
|
|
|
|
string line = err[2].str(); |
|
|
|
|
string col = err[3].str(); |
|
|
|
|
string type = err[4].str(); |
|
|
|
|
string message = err[5].str(); |
|
|
|
|
|
|
|
|
|
print("{},{},{},{},{}\n", |
|
|
|
|
file_name, line, col, type, message); |
|
|
|
|
stats_out << put_time(&tm, "%FT%TZ"); |
|
|
|
|
stats_out << format(",{},{},{},{},{}\n", file_name, line, col, type, message); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
stats_out.close(); |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|