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

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   auto t = uc.NewTransformer();
   auto logText = "ERROR: Fail 1. INFO: OK. ERROR: Fail 2. ERROR: Fail 3.";
   t.Text(logText);

   auto errorRule = t.Pattern("ERROR: {msg}.");
   // Stop after finding the first error to focus on the initial problem.
   errorRule.StopAfter(1);
   t.Find();

   cout << "First error found: " << t.Matches().Text() << endl;
}