Exemplo n.º 1
0
 public void AddJournalEntry(string text)
 {
     if (!string.IsNullOrEmpty(text))
     {
         Journal.Add(text);
         Log.Info(text);
         JournalAdded?.Invoke(text);
     }
 }
Exemplo n.º 2
0
        public void AddJournalAndLog(string journalText, string logText, bool isError = false)
        {
            if (!string.IsNullOrEmpty(journalText))
            {
                Journal.Add(journalText);
                Log.Info(journalText);
                JournalAdded?.Invoke(journalText);
            }

            if (!string.IsNullOrEmpty(logText))
            {
                if (isError)
                {
                    Errors.Add($"ERROR - {logText}");
                    Log.Error(logText);
                }
                else
                {
                    Errors.Add($"INFO - {logText}");
                    Log.Info(logText);
                }
                ErrorAdded?.Invoke(logText);
            }
        }