Ejemplo n.º 1
0
        /////////////////////////////////////////////////

        private void StartWorker()
        {
            if (!Directory.Exists(log_dir))
            {
                GLib.Timeout.Add(60000, new GLib.TimeoutHandler(CheckForExistence));
                return;
            }

            Logger.Log.Info("Starting Empathy log backend");

            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            if (Inotify.Enabled)
            {
                Watch(log_dir);
            }

            crawler = new EmpathyCrawler(log_dir);
            Crawl();

            if (!Inotify.Enabled)
            {
                Scheduler.Task task = Scheduler.TaskFromHook(new Scheduler.TaskHook(CrawlHook));
                task.Tag    = "Crawling ~/.gnome2/Empathy to find new logfiles";
                task.Source = this;
                ThisScheduler.Add(task);
            }

            stopwatch.Stop();

            Logger.Log.Info("Empathy log backend worker thread done in {0}", stopwatch);
        }
Ejemplo n.º 2
0
		/////////////////////////////////////////////////
					
		private void StartWorker() 
		{		
			if (! Directory.Exists (log_dir)) {
				GLib.Timeout.Add (60000, new GLib.TimeoutHandler (CheckForExistence));
				return;
			}

			Logger.Log.Info ("Starting Empathy log backend");

			Stopwatch stopwatch = new Stopwatch ();
			stopwatch.Start ();

			if (Inotify.Enabled)
				Watch (log_dir);

			crawler = new EmpathyCrawler (log_dir);
			Crawl ();

			if (!Inotify.Enabled) {
				Scheduler.Task task = Scheduler.TaskFromHook (new Scheduler.TaskHook (CrawlHook));
				task.Tag = "Crawling ~/.gnome2/Empathy to find new logfiles";
				task.Source = this;
				ThisScheduler.Add (task);
			}

			stopwatch.Stop ();

			Logger.Log.Info ("Empathy log backend worker thread done in {0}", stopwatch); 
		}
Ejemplo n.º 3
0
        /////////////////////////////////////////////////

        private void Crawl()
        {
            crawler.Crawl();
            foreach (FileInfo file in crawler.Logs)
            {
                IndexLog(file.FullName, Scheduler.Priority.Delayed);
            }

            if (Inotify.Enabled)
            {
                crawler = null;                 // Free crawler since we do not need it any more
            }
        }
Ejemplo n.º 4
0
		/////////////////////////////////////////////////

		private void Crawl ()
		{
			crawler.Crawl ();
			foreach (FileInfo file in crawler.Logs)
				IndexLog (file.FullName, Scheduler.Priority.Delayed);

			if (Inotify.Enabled)
				crawler = null; // Free crawler since we do not need it any more
		}