Esempio n. 1
0
        /// <summary>
        ///     Initializes this log file.
        /// </summary>
        /// <param name="scheduler"></param>
        protected AbstractLogFile(ITaskScheduler scheduler)
        {
            if (scheduler == null)
            {
                throw new ArgumentNullException(nameof(scheduler));
            }

            _scheduler = scheduler;
            _cancellationTokenSource = new CancellationTokenSource();
            Listeners = new LogFileListenerCollection(this);
        }
Esempio n. 2
0
        /// <summary>
        ///     Initializes this object.
        /// </summary>
        /// <param name="columns"></param>
        public InMemoryLogFile(IEnumerable <ILogFileColumn> columns)
        {
            if (columns == null)
            {
                throw new ArgumentNullException(nameof(columns));
            }

            _syncRoot   = new object();
            _logEntries = new LogEntryList(LogFileColumns.CombineWithMinimum(columns));
            _listeners  = new LogFileListenerCollection(this);

            _properties = new LogFilePropertyList(LogFileProperties.Minimum);
            _properties.SetValue(LogFileProperties.Size, Size.Zero);
        }
Esempio n. 3
0
        /// <summary>
        ///     Initializes this object.
        /// </summary>
        /// <param name="taskScheduler"></param>
        /// <param name="maximumWaitTime"></param>
        public LogFileProxy(ITaskScheduler taskScheduler, TimeSpan maximumWaitTime)
        {
            if (taskScheduler == null)
            {
                throw new ArgumentNullException(nameof(taskScheduler));
            }

            _taskScheduler   = taskScheduler;
            _pendingSections = new ConcurrentQueue <KeyValuePair <ILogFile, LogFileSection> >();
            _listeners       = new LogFileListenerCollection(this);

            _task            = _taskScheduler.StartPeriodic(RunOnce, "Log File Proxy");
            _maximumWaitTime = maximumWaitTime;
        }