#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   uCalc::Transformer t;
   auto logText = "INFO: System start. WARN: Low disk. ERROR: DB connection failed.";
   t.Text(logText);

   // Define rules for different log levels
   auto errorRule = t.Pattern("ERROR: {msg}.");
   auto warnRule = t.Pattern("WARN: {msg}.");

   t.Find();

   cout << "Total issues found: " << t.Matches().Count() << endl;
   cout << "--- Error Matches ---" << endl;
   cout << errorRule.Matches().Text() << endl;
   cout << "--- Warning Matches ---" << endl;
   cout << warnRule.Matches().Text() << endl;
}