/// <summary> /// Add a Log object to the list of logs /// </summary> /// <param name="l">The Log object that needs to be added</param> internal void AddLog(Log l) { _logList.Add(l); LogAddedEvent?.Invoke(l); if (_saveToFile) { WriteLogToFile(l); } }
/// <summary> /// Add a Log object to the log repository /// </summary> /// <param name="log">The Log that should be added to the log repository</param> public void AddLog(Log log) { foreach (LogAppender exporter in LogAppenders) { exporter.ExportLog(log); } LogAddedEvent?.Invoke(log); }
/// <summary> /// Add a Log object to the LogRepository instance asynchronously /// </summary> /// <param name="log">The Log object that should be added to the LogRepository instance</param> /// <returns>The Task object that is associated with this asynchronous method</returns> public async Task AddLogAsync(Log log) { await Task.Run(async() => { foreach (LogAppender exporter in LogAppenders) { await exporter.ExportLogAsync(log); } LogAddedEvent?.Invoke(log); }); }
/// <summary> /// Add a Log object to the list of logs /// </summary> /// <param name="l">The Log object that needs to be added</param> internal void AddLog(Log l) { if (!_loggingEnabled) { return; } _logList.Add(l); LogAddedEvent?.Invoke(l); if (_saveToFile) { WriteLogToFile(l); } }
/// <summary> /// Add a Log object to the list of logs /// </summary> /// <param name="l">The Log object that needs to be added</param> internal void AddLog(Log l) { _logList.Add(l); LogAddedEvent?.Invoke(l); }