Ejemplo n.º 1
0
        public void StopWatchingFiles()
        {
            LogFileUpdateHandler.Reset();

            _watcher.EnableRaisingEvents = false;
            foreach (var agentLogConsumer in Consumers)
            {
                agentLogConsumer.OnStoped();
            }
        }
Ejemplo n.º 2
0
        public void StartWatchingFiles(bool debugMode, string path, string fileFilter, params IAgentLogConsumer[] consumers)
        {
            LogFileUpdateHandler.Reset();

            Consumers                      = consumers.ToList();
            _watcher.Path                  = path;
            _watcher.NotifyFilter          = NotifyFilters.LastWrite;
            _watcher.Filter                = fileFilter;
            _watcher.Changed              += OnChanged;
            _watcher.IncludeSubdirectories = true;
            _watcher.EnableRaisingEvents   = true;
            foreach (var agentLogConsumer in Consumers)
            {
                agentLogConsumer.Start(debugMode);
            }
        }