public void AddConsoleOutput(string text, bool logtime = true) { if (LogToConsole) { Console.WriteLine(text); } else { ConsoleOutputList.Add(text); ConsoleOutput = string.Join("\n", ConsoleOutputList); } }
public void AddErrorOutput(string text) { lock (_lockObject) { if (LogToConsole) { Console.WriteLine($"ERROR :{text}"); ErrorOutputList.Add(text); } else { var initialcount = ErrorOutputList.Count; ErrorOutputList.Add(text); if (ErrorOutputList.Count > initialcount) { var errortext = $"ERROR {initialcount + 1}: {text}"; ConsoleOutputList.Add(errortext); ConsoleOutput = string.Join("\n", ConsoleOutputList); } } } }