using uCalcSoftware;

var uc = new uCalc();
var t = new uCalc.Transformer();
var 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();

Console.WriteLine("All log entries:");
Console.WriteLine(t.GetMatches().Text);
Console.WriteLine("");

Console.WriteLine("Critical errors only:");
// Use the option to filter for only the important entries
var errorMatches = t.GetMatches(MatchesOption.FocusableOnly);
Console.WriteLine(errorMatches.Text);