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

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   uCalc::Transformer t;
   auto log = "INFO: Task started. ERROR: Connection failed. INFO: Task finished.";
   t.Text(log);

   // Rules for different log levels. Only errors are focusable.
   t.Pattern("INFO: {msg}.").SetFocusable(false);
   t.Pattern("ERROR: {msg}.").SetFocusable(true);
   t.Find();

   cout << "All log entries:" << endl;
   cout << t.GetMatches().Text() << endl;
   cout << "" << endl;

   cout << "Critical errors only:" << endl;
   // Use the option to filter for only the important entries
   auto errorMatches = t.GetMatches(MatchesOption::FocusableOnly);
   cout << errorMatches.Text() << endl;
}