Exemplo n.º 1
0
 /// <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);
     }
 }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
        /// <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);
            });
        }
Exemplo n.º 4
0
        /// <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);
            }
        }
Exemplo n.º 5
0
 /// <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);
 }