beagle r4898 - in trunk/beagle/beagled: . IndexHelper



Author: dbera
Date: Sat Dec 27 00:25:25 2008
New Revision: 4898
URL: http://svn.gnome.org/viewvc/beagle?rev=4898&view=rev

Log:
Automatically turn on debugging in IndexHelper if debugging is enabled in BeagleDaemon.


Modified:
   trunk/beagle/beagled/IndexHelper/IndexHelper.cs
   trunk/beagle/beagled/RemoteIndexer.cs

Modified: trunk/beagle/beagled/IndexHelper/IndexHelper.cs
==============================================================================
--- trunk/beagle/beagled/IndexHelper/IndexHelper.cs	(original)
+++ trunk/beagle/beagled/IndexHelper/IndexHelper.cs	Sat Dec 27 00:25:25 2008
@@ -85,21 +85,19 @@
 			bool run_by_hand = (Environment.GetEnvironmentVariable ("BEAGLE_RUN_HELPER_BY_HAND") != null);
 			bool log_in_fg = (Environment.GetEnvironmentVariable ("BEAGLE_LOG_IN_THE_FOREGROUND_PLEASE") != null);
 
-			if (args.Length == 1 && args [0] == "--disable-text-cache")
-				disable_textcache = true;
-			else
-				disable_textcache = false;
-			
-			// FIXME: We always turn on full debugging output!  We are still
-			// debugging this code, after all...
-			//bool debug = (Environment.GetEnvironmentVariable ("BEAGLE_DEBUG_FLAG_IS_SET") != null);
+			bool debug = false, disable_textcache = false;
+
+			foreach (string arg in args)
+				if (arg == "--disable-text-cache")
+					disable_textcache = true;
+				else if (arg == "--debug")
+					debug = true;
 
 			last_activity = DateTime.Now;
 
 			Log.Initialize (PathFinder.LogDir,
 					"IndexHelper",
-					//debug ? LogLevel.Debug : LogLevel.Warn,
-					LogLevel.Debug,
+					debug ? LogLevel.Debug : LogLevel.Warn,
 					run_by_hand || log_in_fg);
 
 			Log.Always ("Starting Index Helper process (version {0})", ExternalStringsHack.Version);

Modified: trunk/beagle/beagled/RemoteIndexer.cs
==============================================================================
--- trunk/beagle/beagled/RemoteIndexer.cs	(original)
+++ trunk/beagle/beagled/RemoteIndexer.cs	Sat Dec 27 00:25:25 2008
@@ -224,10 +224,20 @@
 				Logger.Log.Debug ("Launching helper process");
 
 				SafeProcess p = new SafeProcess ();
+				string[] args = new string [3];
+				args [0] = helper_path;
+
 				if (BeagleDaemon.DisableTextCache)
-					p.Arguments = new string [] { helper_path, "--disable-text-cache" };
+					args [1] = "--disable-text-cache";
+				else
+					args [1] = String.Empty;
+
+				if (Log.Level == LogLevel.Debug)
+					args [2] = "--debug";
 				else
-					p.Arguments = new string [] { helper_path };
+					args [2] = String.Empty;
+
+				p.Arguments = args;
 				p.RedirectStandardOutput = false;
 				p.RedirectStandardError = false;
 				p.Start ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]