public void Info(string text) { LogEntries.Add(new LogItem { DateTime = DateTime.Now.ToString("HH:mm:ss"), Message = text }); LogItemAdded?.Invoke(null, null); }
public static void Log(LogType type, string message) { var item = new LogItem { Type = type, Time = DateTime.UtcNow, Message = message }; LogItemAdded?.Invoke(item); lock (LogLock) { if (_fileOutput) { File.AppendAllText(_filename, $"{item.Time.ToLongTimeString()} > [{item.Type}] {item.Message}" + Environment.NewLine); } ConsoleOutput(item); } }