public async Task Log(string message, LogLevel logLevel = LogLevel.Info) { LogMessage newLogMessage = null; await Task.Run(() => { newLogMessage = new LogMessage(message, logLevel); _currentLogs.Add(newLogMessage); }); NewLogEvent?.Invoke(newLogMessage); }
protected virtual void OnNewLogEvent(EventArgs e) { NewLogEvent?.Invoke(this, e); }