Exemplo n.º 1
0
 /// <summary>Makes copies of the log records from <paramref name="srcAggregator"/>.</summary>
 /// <remarks>Does a deep copy of every record.</remarks>
 /// <param name="srcAggregator">An aggregator to get log records from.</param>
 public void LoadLogs(BaseLogAggregator srcAggregator)
 {
     ClearAllLogs();
     foreach (var log in srcAggregator.GetLogRecords())
     {
         AggregateLogRecord(log);
     }
 }
Exemplo n.º 2
0
        /// <summary>Populates <see cref="logsToShow"/> and stats numbers.</summary>
        /// <remarks>Current aggregator is determined from <see cref="logShowMode"/> and
        /// <see cref="logUpdateIsPaused"/></remarks>
        /// <param name="forceUpdate">If <c>false</c> then logs view will only be updated if there were
        /// newly aggregated records in teh current aggregator.</param>
        private void UpdateLogsView(bool forceUpdate = false)
        {
            BaseLogAggregator currentAggregator = GetCurrentAggregator();

            if (currentAggregator.FlushBufferedLogs() || logsViewChanged || forceUpdate)
            {
                logsToShow    = currentAggregator.GetLogRecords();
                infoLogs      = currentAggregator.infoLogsCount;
                warningLogs   = currentAggregator.warningLogsCount;
                errorLogs     = currentAggregator.errorLogsCount;
                exceptionLogs = currentAggregator.exceptionLogsCount;
            }
            logsViewChanged = false;
        }
Exemplo n.º 3
0
        /// <summary>Returns an aggregator for teh currentkly selected mode.</summary>
        /// <param name="ignorePaused">If <c>true</c> then snapshot aggregator is not considered.</param>
        /// <returns>An aggregator.</returns>
        private BaseLogAggregator GetCurrentAggregator(bool ignorePaused = false)
        {
            BaseLogAggregator currentAggregator = snapshotLogAggregator;

            if (ignorePaused || !logUpdateIsPaused)
            {
                if (logShowMode == ShowMode.Raw)
                {
                    currentAggregator = rawLogAggregator;
                }
                else if (logShowMode == ShowMode.Collapsed)
                {
                    currentAggregator = collapseLogAggregator;
                }
                else
                {
                    currentAggregator = smartLogAggregator;
                }
            }
            return(currentAggregator);
        }