Exemplo n.º 1
0
        internal LogSourcesManager(
            IHeartBeatTimer heartbeat,
            MRU.IRecentlyUsedEntities recentlyUsedEntities,
            IShutdown shutdown,
            ITraceSourceFactory traceSourceFactory,
            IChangeNotification changeNotification,
            ILogSourceFactory logSourceFactory
            )
        {
            this.tracer               = traceSourceFactory.CreateTraceSource("LogSourcesManager", "lsm");
            this.logSourceFactory     = logSourceFactory;
            this.recentlyUsedEntities = recentlyUsedEntities;
            this.changeNotification   = changeNotification;

            this.visibleItems = Selectors.Create(
                () => logSources,
                () => visibilityRevision,
                (items, _) => ImmutableArray.CreateRange(items.Where(i => i.Visible))
                );

            heartbeat.OnTimer += (s, e) =>
            {
                if (e.IsRareUpdate)
                {
                    PeriodicUpdate();
                }
            };

            shutdown.Cleanup += (sender, e) =>
            {
                shutdown.AddCleanupTask(this.DeleteAllLogs());
            };
        }
Exemplo n.º 2
0
 public FolderDataSource(ITaskScheduler taskScheduler,
                         ILogSourceFactory logSourceFactory,
                         IFilesystem filesystem,
                         DataSource settings)
     : this(taskScheduler, logSourceFactory, filesystem, settings, TimeSpan.FromMilliseconds(value : 10))
 {
 }
Exemplo n.º 3
0
 public void OneTimeSetUp()
 {
     _scheduler           = new ManualTaskScheduler();
     _logSourceFactory    = new SimplePluginLogSourceFactory(_scheduler);
     _actionCenter        = new Mock <IActionCenter>();
     _applicationSettings = new Mock <IApplicationSettings>();
 }
Exemplo n.º 4
0
 public void TestFixtureSetUp()
 {
     _taskScheduler    = new DefaultTaskScheduler();
     _logSourceFactory = new SimplePluginLogSourceFactory(_taskScheduler);
     _actionCenter     = new Mock <IActionCenter>();
     _settings         = new ApplicationSettings(PathEx.GetTempFileName());
 }
Exemplo n.º 5
0
        public FileDataSource(ILogSourceFactory logSourceFactory, ITaskScheduler taskScheduler, DataSource settings,
                              TimeSpan maximumWaitTime)
            : base(taskScheduler, settings, maximumWaitTime)
        {
            if (logSourceFactory == null)
            {
                throw new ArgumentNullException(nameof(logSourceFactory));
            }

            _originalLogSource   = logSourceFactory.Open(settings.File);
            _unfilteredLogSource = new LogSourceProxy(TaskScheduler, MaximumWaitTime);
            OnSingleLineChanged();
            OnUnfilteredLogFileChanged();
        }
Exemplo n.º 6
0
        internal LogSourcesManager(
            IHeartBeatTimer heartbeat,
            ILogSourceFactory logSourceFactory
            )
        {
            this.tracer           = new LJTraceSource("LogSourcesManager", "lsm");
            this.logSourceFactory = logSourceFactory;

            heartbeat.OnTimer += (s, e) =>
            {
                if (e.IsRareUpdate)
                {
                    PeriodicUpdate();
                }
            };
        }
Exemplo n.º 7
0
        public FolderDataSource(ITaskScheduler taskScheduler,
                                ILogSourceFactory logSourceFactory,
                                IFilesystem filesystem,
                                DataSource settings,
                                TimeSpan maximumWaitTime)
        {
            _taskScheduler            = taskScheduler;
            _logSourceFactory         = logSourceFactory;
            _filesystem               = filesystem;
            _settings                 = settings;
            _syncRoot                 = new object();
            _dataSources              = new Dictionary <IFileInfo, FileDataSource>();
            _mergedDataSource         = new MergedDataSource(taskScheduler, settings, maximumWaitTime);
            _unfilteredLogSourceProxy = new LogSourceProxy(taskScheduler, maximumWaitTime);
            _filteredLogSourceProxy   = new LogSourceProxy(taskScheduler, maximumWaitTime);

            DoChange();
        }
Exemplo n.º 8
0
 public static void SetLogSourceFactory(ILogSourceFactory factory)
 {
     Instance.logSourceFactory = factory;
 }
Exemplo n.º 9
0
 private JobLogger()
 {
     logConfiguration = Locator.Resolve <ILogConfiguration>() ?? new DefaultLogConfiguration();
     logSourceFactory = Locator.Resolve <ILogSourceFactory>() ?? new LogSourceFactory();
 }
Exemplo n.º 10
0
 public FileDataSource(ILogSourceFactory logSourceFactory, ITaskScheduler taskScheduler, DataSource settings)
     : this(logSourceFactory, taskScheduler, settings, TimeSpan.FromMilliseconds(value : 10))
 {
 }