Example #1
0
 public MultiThreadedStrategy(ILogMedia media, Encoding encoding, IRegex headerRe,
                              MessagesSplitterFlags splitterFlags, TextStreamPositioningParams textStreamPositioningParams,
                              string parentLoggingPrefix, ITraceSourceFactory traceSourceFactory)
     : this(media, encoding, headerRe, splitterFlags, false, textStreamPositioningParams, parentLoggingPrefix, traceSourceFactory)
 {
     BytesToParsePerThread = GetBytesToParsePerThread(textStreamPositioningParams);
 }
Example #2
0
 public WorkspacesManager(
     ILogSourcesManager logSources,
     ILogProviderFactoryRegistry logProviderFactoryRegistry,
     IStorageManager storageManager,
     Backend.IBackendAccess backend,
     ITempFilesManager tempFilesManager,
     MRU.IRecentlyUsedEntities recentlyUsedEntities,
     IShutdown shutdown,
     ITraceSourceFactory traceSourceFactory
     )
 {
     this.tracer                     = traceSourceFactory.CreateTraceSource("Workspaces", "ws");
     this.logSources                 = logSources;
     this.backendAccess              = backend;
     this.tempFilesManager           = tempFilesManager;
     this.logProviderFactoryRegistry = logProviderFactoryRegistry;
     this.storageManager             = storageManager;
     this.recentlyUsedEntities       = recentlyUsedEntities;
     if (backend.IsConfigured)
     {
         this.status = WorkspacesManagerStatus.NoWorkspace;
     }
     else
     {
         this.status = WorkspacesManagerStatus.Unavailable;
     }
     shutdown.Cleanup += (s, e) => shutdown.AddCleanupTask(
         WaitUploadCompletion().WithTimeout(TimeSpan.FromSeconds(10)));
 }
Example #3
0
 public PreprocessingStepsFactory(
     Workspaces.IWorkspacesManager workspacesManager,
     AppLaunch.ILaunchUrlParser appLaunch,
     ISynchronizationContext invoke,
     IExtensionsRegistry extentions,
     Progress.IProgressAggregator progressAggregator,
     Persistence.IWebContentCache cache,
     ICredentialsCache credCache,
     ILogProviderFactoryRegistry logProviderFactoryRegistry,
     WebViewTools.IWebViewTools webBrowserDownloader,
     ILogsDownloaderConfig logsDownloaderConfig,
     ITraceSourceFactory traceSourceFactory
     )
 {
     this.workspacesManager  = workspacesManager;
     this.appLaunch          = appLaunch;
     this.invoke             = invoke;
     this.extentions         = extentions;
     this.progressAggregator = progressAggregator;
     this.cache     = cache;
     this.credCache = credCache;
     this.logProviderFactoryRegistry = logProviderFactoryRegistry;
     this.webViewTools         = webBrowserDownloader;
     this.logsDownloaderConfig = logsDownloaderConfig;
     this.traceSourceFactory   = traceSourceFactory;
 }
Example #4
0
 public Factory(
     ITempFilesManager tempFiles,
     ITraceSourceFactory traceSourceFactory,
     MultiInstance.IInstancesCounter mutualExecutionCounter,
     IShutdown shutdown,
     ISynchronizationContext synchronizationContext,
     Persistence.IFirstStartDetector firstStartDetector,
     Telemetry.ITelemetryCollector telemetry,
     Persistence.IStorageManager storage,
     IChangeNotification changeNotification,
     string autoUpdateUrl,
     string pluginsIndexUrl
     )
 {
     this.tempFiles              = tempFiles;
     this.traceSourceFactory     = traceSourceFactory;
     this.shutdown               = shutdown;
     this.synchronizationContext = synchronizationContext;
     this.mutualExecutionCounter = mutualExecutionCounter;
     this.firstStartDetector     = firstStartDetector;
     this.telemetry              = telemetry;
     this.storage            = storage;
     this.changeNotification = changeNotification;
     this.autoUpdateUrl      = autoUpdateUrl;
     this.pluginsIndexUrl    = pluginsIndexUrl;
 }
Example #5
0
 public Factory(
     IAlertPopup alerts,
     IFileDialogs fileDialogs,
     Help.IPresenter help,
     ILogProviderFactoryRegistry registry,
     IFormatDefinitionsRepository repo,
     IUserDefinedFormatsManager userDefinedFormatsManager,
     ITempFilesManager tempFilesManager,
     ITraceSourceFactory traceSourceFactory,
     RegularExpressions.IRegexFactory regexFactory,
     LogViewer.IPresenterFactory logViewerPresenterFactory,
     IViewsFactory viewFactories,
     ISynchronizationContext synchronizationContext,
     FieldsProcessor.IFactory fieldsProcessorFactory
     )
 {
     this.viewFactories             = viewFactories;
     this.alerts                    = alerts;
     this.registry                  = registry;
     this.fileDialogs               = fileDialogs;
     this.userDefinedFormatsManager = userDefinedFormatsManager;
     this.help                      = help;
     this.repo                      = repo;
     this.tempFilesManager          = tempFilesManager;
     this.logViewerPresenterFactory = logViewerPresenterFactory;
     this.traceSourceFactory        = traceSourceFactory;
     this.regexFactory              = regexFactory;
     this.synchronizationContext    = synchronizationContext;
     this.fieldsProcessorFactory    = fieldsProcessorFactory;
 }
        public LogSourcesPreprocessingManager(
            ISynchronizationContext invokeSynchronize,
            IFormatAutodetect formatAutodetect,
            IExtensionsRegistry extensions,
            IPreprocessingManagerExtension builtinStepsExtension,
            Telemetry.ITelemetryCollector telemetry,
            ITempFilesManager tempFilesManager,
            ILogSourcesManager logSourcesManager,
            IShutdown shutdown,
            ITraceSourceFactory traceSourceFactory,
            IChangeNotification changeNotification
            )
        {
            this.traceSourceFactory = traceSourceFactory;
            this.trace                   = traceSourceFactory.CreateTraceSource("PreprocessingManager", "prepr");
            this.invokeSynchronize       = invokeSynchronize;
            this.formatAutodetect        = formatAutodetect;
            this.providerYieldedCallback = prov => logSourcesManager.Create(prov.Factory, prov.ConnectionParams).Visible = !prov.IsHiddenLog;
            this.extensions              = extensions;
            this.telemetry               = telemetry;
            this.tempFilesManager        = tempFilesManager;
            this.logSourcesManager       = logSourcesManager;
            this.changeNotification      = changeNotification;

            extensions.Register(builtinStepsExtension);

            shutdown.Cleanup += (sender, e) =>
            {
                shutdown.AddCleanupTask(this.DeleteAllPreprocessings());
            };
        }
Example #7
0
        public Presenter(
            IBookmarks bookmarks,
            IView view,
            LogViewer.IPresenter viewerPresenter,
            SearchResult.IPresenter searchResultPresenter,
            BookmarksList.IPresenter listPresenter,
            StatusReports.IPresenter statusReportFactory,
            IPresentersFacade navHandler,
            IAlertPopup alerts,
            ITraceSourceFactory traceSourceFactory
            )
        {
            this.bookmarks             = bookmarks;
            this.view                  = view;
            this.viewerPresenter       = viewerPresenter;
            this.tracer                = traceSourceFactory.CreateTraceSource("UI", "ui.bmkm");
            this.statusReportFactory   = statusReportFactory;
            this.searchResultPresenter = searchResultPresenter;
            this.navHandler            = navHandler;
            this.listPresenter         = listPresenter;
            this.alerts                = alerts;

            listPresenter.Click += (s, bmk) =>
            {
                IPresenter myPublicIntf = this;
                myPublicIntf.NavigateToBookmark(bmk, BookmarkNavigationOptions.EnablePopups | BookmarkNavigationOptions.BookmarksStringsSet);
            };

            view.SetPresenter(this);
        }
Example #8
0
 public NativeXMLFormatFactory(ITempFilesManager tempFiles, IRegexFactory regexFactory, ITraceSourceFactory traceSourceFactory)
 {
     this.tempFiles          = tempFiles;
     this.regexFactory       = regexFactory;
     this.traceSourceFactory = traceSourceFactory;
     this.nativeFormatInfo   = XmlFormatInfo.MakeNativeFormatInfo("utf-8", null, new FormatViewOptions(), regexFactory);
 }
Example #9
0
        public Presenter(
            IBookmarks bookmarks,
            ILogSourcesManager sourcesManager,
            IView view,
            IHeartBeatTimer heartbeat,
            LoadedMessages.IPresenter loadedMessagesPresenter,
            IClipboardAccess clipboardAccess,
            IColorTheme colorTheme,
            IChangeNotification changeNotification,
            ITraceSourceFactory traceSourceFactory
            )
        {
            this.bookmarks = bookmarks;
            this.view      = view;
            this.loadedMessagesPresenter = loadedMessagesPresenter;
            this.clipboardAccess         = clipboardAccess;
            this.colorTheme         = colorTheme;
            this.changeNotification = changeNotification;
            this.trace = traceSourceFactory.CreateTraceSource("UI", "bmks");

            itemsSelector = Selectors.Create(
                () => bookmarks.Items,
                () => selectedBookmarks,
                () => colorTheme.ThreadColors,
                () => loadedMessagesPresenter.LogViewerPresenter.Coloring,
                CreateViewItems
                );
            focusedMessagePositionSelector = Selectors.Create(
                () => loadedMessagesPresenter.LogViewerPresenter.FocusedMessageBookmark,
                () => bookmarks.Items,
                FindFocusedMessagePosition
                );

            view.SetViewModel(this);
        }
Example #10
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());
            };
        }
Example #11
0
        public Presenter(
            IView view,
            ITempFilesManager tempFilesManager,
            ITraceSourceFactory traceSourceFactory,
            RegularExpressions.IRegexFactory regexFactory,
            LogViewer.IPresenterFactory logViewerPresenterFactory,
            ISynchronizationContext synchronizationContext,
            LogMedia.IFileSystem fileSystem
            )
        {
            this.view = view;
            this.view.SetEventsHandler(this);
            this.tempFilesManager       = tempFilesManager;
            this.traceSourceFactory     = traceSourceFactory;
            this.regexFactory           = regexFactory;
            this.synchronizationContext = synchronizationContext;
            this.fileSystem             = fileSystem;

            this.threads          = new ModelThreads();
            this.logSourceThreads = new LogSourceThreads(
                LJTraceSource.EmptyTracer, threads, null);
            this.model            = new Presenters.LogViewer.DummyModel();
            this.logPresenter     = logViewerPresenterFactory.CreateIsolatedPresenter(model, view.LogViewer);
            logPresenter.ShowTime = true;
            logPresenter.EmptyViewMessageAllowed = false;
        }
        public PluggableProtocolManager(
            ITraceSourceFactory traceSourceFactory,
            MultiInstance.IInstancesCounter instancesCounter,
            IShutdown shutdown,
            Telemetry.ITelemetryCollector telemetryCollector,
            Persistence.IFirstStartDetector firstStartDetector,
            ILaunchUrlParser launchUrlParser
            )
        {
            this.tracer          = traceSourceFactory.CreateTraceSource("PluggableProtocol");
            this.launchUrlParser = launchUrlParser;

            if (instancesCounter.IsPrimaryInstance)
            {
                this.regUpdater = RegistryUpdater(shutdown.ShutdownToken, telemetryCollector, firstStartDetector.IsFirstStartDetected);
            }

            shutdown.Cleanup += (s, e) =>
            {
                if (regUpdater != null)
                {
                    shutdown.AddCleanupTask(regUpdater.WithTimeout(TimeSpan.FromSeconds(1)));
                }
            };
        }
Example #13
0
        public PostprocessorsManager(
            ILogSourcesManager logSources,
            Telemetry.ITelemetryCollector telemetry,
            ISynchronizationContext modelSyncContext,
            ISynchronizationContext threadPoolSyncContext,
            IHeartBeatTimer heartbeat,
            Progress.IProgressAggregator progressAggregator,
            Settings.IGlobalSettingsAccessor settingsAccessor,
            IOutputDataDeserializer outputDataDeserializer,
            ITraceSourceFactory traceSourceFactory
            )
        {
            this.logSources             = logSources;
            this.telemetry              = telemetry;
            this.progressAggregator     = progressAggregator;
            this.settingsAccessor       = settingsAccessor;
            this.modelSyncContext       = modelSyncContext;
            this.threadPoolSyncContext  = threadPoolSyncContext;
            this.heartbeat              = heartbeat;
            this.outputDataDeserializer = outputDataDeserializer;
            this.tracer  = traceSourceFactory.CreateTraceSource("App", "ppm");
            this.updater = new AsyncInvokeHelper(modelSyncContext, Refresh);

            logSources.OnLogSourceAdded             += (sender, args) => updater.Invoke();
            logSources.OnLogSourceRemoved           += (sender, args) => updater.Invoke();
            logSources.OnLogSourceAnnotationChanged += (sender, args) => updater.Invoke();
            logSources.OnLogSourceStatsChanged      += (object sender, LogSourceStatsEventArgs e) =>
            {
                if ((e.Flags & LogProviderStatsFlag.ContentsEtag) != 0)
                {
                    updater.Invoke();
                }
            };
            Refresh();
        }
Example #14
0
 public MessagesReader(MediaBasedReaderParams readerParams, JsonFormatInfo fmt) :
     base(readerParams.Media, fmt.BeginFinder, fmt.EndFinder, fmt.ExtensionsInitData, fmt.TextStreamPositioningParams, readerParams.Flags, readerParams.SettingsAccessor)
 {
     this.formatInfo         = fmt;
     this.threads            = readerParams.Threads;
     this.traceSourceFactory = readerParams.TraceSourceFactory;
 }
Example #15
0
        public MessagesReader(
            MediaBasedReaderParams readerParams,
            FormatInfo fmt,
            FieldsProcessor.IFactory fieldsProcessorFactory,
            IRegexFactory regexFactory,
            ITraceSourceFactory traceSourceFactory
            ) :
            base(readerParams.Media, fmt.BeginFinder, fmt.EndFinder, fmt.ExtensionsInitData, fmt.TextStreamPositioningParams, readerParams.Flags, readerParams.SettingsAccessor)
        {
            if (readerParams.Threads == null)
            {
                throw new ArgumentNullException(nameof(readerParams) + ".Threads");
            }
            this.threads                = readerParams.Threads;
            this.traceSourceFactory     = traceSourceFactory;
            this.regexFactory           = regexFactory;
            this.fmtInfo                = fmt;
            this.fieldsProcessorFactory = fieldsProcessorFactory;
            this.trace = traceSourceFactory.CreateTraceSource("LogSource", string.Format("{0}.r{1:x4}", readerParams.ParentLoggingPrefix, Hashing.GetShortHashCode(this.GetHashCode())));

            base.Extensions.AttachExtensions();

            this.isBodySingleFieldExpression = new Lazy <bool>(() =>
            {
                return(CreateNewFieldsProcessor().IsBodySingleFieldExpression());
            });
        }
Example #16
0
 public FormatAutodetect(Func <ILogProviderFactory, int> mruIndexGetter, ILogProviderFactoryRegistry factoriesRegistry,
                         ITraceSourceFactory traceSourceFactory)
 {
     this.mruIndexGetter     = mruIndexGetter;
     this.factoriesRegistry  = factoriesRegistry;
     this.traceSourceFactory = traceSourceFactory;
 }
Example #17
0
 public PersistentUserDataManager(ITraceSourceFactory traceSourceFactory, Implementation.IStorageManagerImplementation impl, IShutdown shutdown)
 {
     this.trace = traceSourceFactory.CreateTraceSource("Storage", "storage");
     this.impl  = impl;
     this.impl.SetTrace(trace);
     this.globalSettingsEntry = new Lazy <IStorageEntry>(() => impl.GetEntry("global", 0));
     shutdown.Cleanup        += (sender, e) => impl.Dispose();
 }
 public AzureWorkspacesBackend(ITraceSourceFactory traceSourceFactory, string configUri)
 {
     this.trace = traceSourceFactory.CreateTraceSource("Workspaces", "wsbackend");
     if (Uri.IsWellFormedUriString(configUri, UriKind.Absolute))
     {
         this.serviceUrl = new Uri(configUri);
     }
 }
Example #19
0
 public FormatAutodetect(Func <ILogProviderFactory, int> mruIndexGetter, ILogProviderFactoryRegistry factoriesRegistry,
                         ITraceSourceFactory traceSourceFactory, LogMedia.IFileSystem fileSystem)
 {
     this.mruIndexGetter     = mruIndexGetter;
     this.factoriesRegistry  = factoriesRegistry;
     this.traceSourceFactory = traceSourceFactory;
     this.fileSystem         = fileSystem;
 }
        public Presenter(
            ILogSourcesManager logSourcesManager,
            IChangeNotification changeNotification,
            IView view,
            Preprocessing.IManager sourcesPreprocessingManager,
            Preprocessing.IStepsFactory preprocessingStepsFactory,
            MRU.IRecentlyUsedEntities mru,
            QuickSearchTextBox.IPresenter searchBoxPresenter,
            IAlertPopup alerts,
            ITraceSourceFactory traceSourceFactory
            )
        {
            this.view = view;
            this.changeNotification          = changeNotification;
            this.logSourcesManager           = logSourcesManager;
            this.sourcesPreprocessingManager = sourcesPreprocessingManager;
            this.preprocessingStepsFactory   = preprocessingStepsFactory;
            this.mru = mru;
            this.searchBoxPresenter = searchBoxPresenter;
            this.trace  = traceSourceFactory.CreateTraceSource("UI", "hist-dlg");
            this.alerts = alerts;

            items            = Selectors.Create(() => visible, () => acceptedFilter, MakeItems);
            actuallySelected = Selectors.Create(() => items().displayItems, () => selected,
                                                (items, selected) => items.SelectMany(i => i.Flatten()).Where(i => selected.Contains(i.key)).ToImmutableList());
            openButtonEnabled = Selectors.Create(actuallySelected, selected => selected.Any(IsOpenable));
            rootViewItem      = Selectors.Create(() => items().displayItems, () => selected, () => expanded, MakeRootItem);

            searchBoxPresenter.OnSearchNow += (s, e) =>
            {
                acceptedFilter = searchBoxPresenter.Text;
                FocusItemsListAndSelectFirstItem();
                changeNotification.Post();
            };
            searchBoxPresenter.OnRealtimeSearch += (s, e) =>
            {
                acceptedFilter = searchBoxPresenter.Text;
                changeNotification.Post();
            };
            searchBoxPresenter.OnCancelled += (s, e) =>
            {
                if (acceptedFilter != "")
                {
                    acceptedFilter = "";
                    searchBoxPresenter.Focus(null);
                }
                else
                {
                    visible = false;
                }
                changeNotification.Post();
            };

            view.SetViewModel(this);
        }
Example #21
0
 public MediaBasedReaderParams(ILogSourceThreadsInternal threads, ILogMedia media, ITempFilesManager tempFilesManager, ITraceSourceFactory traceSourceFactory, MessagesReaderFlags flags = MessagesReaderFlags.None,
                               Settings.IGlobalSettingsAccessor settingsAccessor = null, string parentLoggingPrefix = null)
 {
     Threads             = threads;
     Media               = media;
     Flags               = flags;
     TempFilesManager    = tempFilesManager;
     TraceSourceFactory  = traceSourceFactory;
     SettingsAccessor    = settingsAccessor ?? Settings.DefaultSettingsAccessor.Instance;
     ParentLoggingPrefix = parentLoggingPrefix;
 }
        public PostprocessorsManager(
            ILogSourcesManager logSources,
            Telemetry.ITelemetryCollector telemetry,
            ISynchronizationContext modelSyncContext,
            ISynchronizationContext threadPoolSyncContext,
            IHeartBeatTimer heartbeat,
            Progress.IProgressAggregator progressAggregator,
            Settings.IGlobalSettingsAccessor settingsAccessor,
            IOutputDataDeserializer outputDataDeserializer,
            ITraceSourceFactory traceSourceFactory,
            ILogPartTokenFactories logPartTokenFactories,
            Correlation.ISameNodeDetectionTokenFactories sameNodeDetectionTokenFactories,
            IChangeNotification changeNotification,
            LogMedia.IFileSystem logFileSystem
            )
        {
            this.logSources                      = logSources;
            this.telemetry                       = telemetry;
            this.progressAggregator              = progressAggregator;
            this.settingsAccessor                = settingsAccessor;
            this.modelSyncContext                = modelSyncContext;
            this.threadPoolSyncContext           = threadPoolSyncContext;
            this.heartbeat                       = heartbeat;
            this.outputDataDeserializer          = outputDataDeserializer;
            this.logPartTokenFactories           = logPartTokenFactories;
            this.sameNodeDetectionTokenFactories = sameNodeDetectionTokenFactories;
            this.changeNotification              = changeNotification;
            this.logFileSystem                   = logFileSystem;
            this.tracer  = traceSourceFactory.CreateTraceSource("App", "ppm");
            this.updater = new AsyncInvokeHelper(modelSyncContext, Refresh);

            logSources.OnLogSourceAdded             += (sender, args) => updater.Invoke();
            logSources.OnLogSourceRemoved           += (sender, args) => updater.Invoke();
            logSources.OnLogSourceAnnotationChanged += (sender, args) => updater.Invoke();
            logSources.OnLogSourceStatsChanged      += (object sender, LogSourceStatsEventArgs e) =>
            {
                if ((e.Flags & LogProviderStatsFlag.ContentsEtag) != 0)
                {
                    updater.Invoke();
                }
            };

            this.visiblePostprocessorsOutputs = Selectors.Create(
                () => postprocessorsOutputs,
                () => logSources.Items,
                (outputs, sources) => {
                var sourcesMap = sources.ToLookup(s => s);
                return(ImmutableArray.CreateRange(outputs.Where(output => sourcesMap.Contains(output.LogSource))));
            }
                );

            Refresh();
        }
Example #23
0
 public TestParsing(
     IAlertPopup alerts,
     ITempFilesManager tempFilesManager,
     ITraceSourceFactory traceSourceFactory,
     IFactory objectsFactory
     )
 {
     this.alerts             = alerts;
     this.tempFilesManager   = tempFilesManager;
     this.traceSourceFactory = traceSourceFactory;
     this.objectsFactory     = objectsFactory;
 }
 public UserDefinedFormatsManager(
     IFormatDefinitionsRepository repository,
     ILogProviderFactoryRegistry registry,
     ITempFilesManager tempFilesManager,
     ITraceSourceFactory traceSourceFactory
     )
 {
     this.repository         = repository ?? throw new ArgumentNullException(nameof(repository));
     this.registry           = registry ?? throw new ArgumentNullException(nameof(registry));
     this.tempFilesManager   = tempFilesManager;
     this.traceSourceFactory = traceSourceFactory;
     this.tracer             = traceSourceFactory.CreateTraceSource("UserDefinedFormatsManager", "udfm");
 }
Example #25
0
 internal TimeAnomalyFixingStep(
     PreprocessingStepParams srcFile,
     Progress.IProgressAggregator progressAggregator,
     ILogProviderFactoryRegistry logProviderFactoryRegistry,
     IStepsFactory preprocessingStepsFactory,
     ITraceSourceFactory traceSourceFactory)
 {
     this.@params = srcFile;
     this.preprocessingStepsFactory  = preprocessingStepsFactory;
     this.progressAggregator         = progressAggregator;
     this.logProviderFactoryRegistry = logProviderFactoryRegistry;
     this.traceSourceFactory         = traceSourceFactory;
 }
 public SearchObjectsFactory(
     Progress.IProgressAggregatorFactory progressAggregatorFactory,
     ISynchronizationContext modelSynchronization,
     Settings.IGlobalSettingsAccessor settings,
     Telemetry.ITelemetryCollector telemetryCollector,
     ITraceSourceFactory traceSourceFactory
     )
 {
     this.progressAggregatorFactory = progressAggregatorFactory;
     this.modelSynchronization      = modelSynchronization;
     this.settings           = settings;
     this.telemetryCollector = telemetryCollector;
     this.traceSourceFactory = traceSourceFactory;
 }
Example #27
0
        public RollingFilesMedia(
            LogMedia.IFileSystem fileSystem,
            Type logReaderType,
            StreamBasedFormatInfo logFormatInfo,
            LJTraceSource traceSource,
            IRollingFilesMediaStrategy rollingStrategy,
            ITempFilesManager tempFilesManager,
            ITraceSourceFactory traceSourceFactory)
        {
            this.traceSourceFactory = traceSourceFactory;
            trace = traceSource;
            using (trace.NewFrame)
            {
                if (fileSystem == null)
                {
                    throw new ArgumentNullException("fileSystem");
                }

                this.rollingStrategy  = rollingStrategy;
                this.logReaderType    = logReaderType;
                this.logFormatInfo    = logFormatInfo;
                this.tempFilesManager = tempFilesManager;

                try
                {
                    this.fileSystem    = fileSystem;
                    this.baseDirectory = rollingStrategy.BaseDirectory;
                    trace.Info("Base file directory: {0}", baseDirectory);

                    this.concatStream = new ConcatReadingStream();
                    this.tempThreads  = new LogSourceThreads(LJTraceSource.EmptyTracer, new ModelThreads(), null);

                    this.fsWatcher                     = fileSystem.CreateWatcher();
                    this.fsWatcher.Path                = this.baseDirectory;
                    this.fsWatcher.Created            += new FileSystemEventHandler(fsWatcher_Created);
                    this.fsWatcher.Renamed            += new RenamedEventHandler(fsWatcher_Renamed);
                    this.fsWatcher.EnableRaisingEvents = true;

                    trace.Info("Watcher enabled");

                    this.folderNeedsRescan = 1;
                }
                catch
                {
                    trace.Error("Initialization failed. Disposing.");
                    Dispose();
                    throw;
                }
            }
        }
Example #28
0
 private static void RegisterPredefinedFormatFactories(
     ILogProviderFactoryRegistry logProviderFactoryRegistry,
     ITempFilesManager tempFilesManager,
     IUserDefinedFormatsManager userDefinedFormatsManager,
     RegularExpressions.IRegexFactory regexFactory,
     ITraceSourceFactory traceSourceFactory)
 {
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
     {
         RegisterWindowsOnlyFactories(logProviderFactoryRegistry);
     }
     logProviderFactoryRegistry.Register(new PlainText.Factory(tempFilesManager));
     logProviderFactoryRegistry.Register(new XmlFormat.NativeXMLFormatFactory(tempFilesManager, regexFactory, traceSourceFactory));
     userDefinedFormatsManager.ReloadFactories();
 }
Example #29
0
 public SearchManager(
     ILogSourcesManager sources,
     Progress.IProgressAggregatorFactory progressAggregatorFactory,
     ISynchronizationContext modelSynchronization,
     Settings.IGlobalSettingsAccessor settings,
     Telemetry.ITelemetryCollector telemetryCollector,
     IChangeNotification changeNotification,
     ITraceSourceFactory traceSourceFactory
     ) : this(
         sources,
         modelSynchronization,
         new SearchObjectsFactory(progressAggregatorFactory, modelSynchronization, settings, telemetryCollector, traceSourceFactory),
         changeNotification
         )
 {
 }
Example #30
0
 public LogSourcesManager(
     IHeartBeatTimer heartbeat,
     ISynchronizationContext invoker,
     IModelThreadsInternal threads,
     ITempFilesManager tempFilesManager,
     Persistence.IStorageManager storageManager,
     IBookmarks bookmarks,
     Settings.IGlobalSettingsAccessor globalSettingsAccess,
     MRU.IRecentlyUsedEntities recentlyUsedEntities,
     IShutdown shutdown,
     ITraceSourceFactory traceSourceFactory,
     IChangeNotification changeNotification
     ) : this(heartbeat, recentlyUsedEntities, shutdown, traceSourceFactory, changeNotification,
              new LogSourceFactory(threads, bookmarks, invoker, storageManager, tempFilesManager, globalSettingsAccess, traceSourceFactory))
 {
 }