/[RomCheater]/trunk/RomCheater.PluginFramework/Core/ConfigPlugin.cs
ViewVC logotype

Diff of /trunk/RomCheater.PluginFramework/Core/ConfigPlugin.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/RomCheater.PluginFramework/Core/ConfigPlugin.cs	2012/05/27 23:34:33	149
+++ trunk/RomCheater.PluginFramework/Core/ConfigPlugin.cs	2012/05/27 23:59:22	150
@@ -1,4 +1,5 @@
-´╗┐using System;
+´╗┐#define DISABLE_VERBOSE_LOGGING_FOR_PERFORMANCE_BOOST // when defined will disable verbose logging for performance speed-up
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -26,6 +27,21 @@
         }
         private void init()
         {
+            loggerflags flags = logger.GetLoggingFlags();
+
+#if DISABLE_VERBOSE_LOGGING_FOR_PERFORMANCE_BOOST
+            ushort performance_flags = flags.Value;
+            if (flags.HasFlag(loggerflags.VERBOSE_DEBUG))
+            {
+                performance_flags = (ushort)(performance_flags &~ loggerflags.VERBOSE_DEBUG.Value);
+            }
+            if (flags.HasFlag(loggerflags.VERBOSE_ERROR))
+            {
+                performance_flags = (ushort)(performance_flags &~ loggerflags.VERBOSE_ERROR.Value);
+            }
+#endif
+            logger.SetLoggingFlags(performance_flags);
+
             List<ProcContainer> proc_list = new List<ProcContainer>();
             foreach (Process proc in Process.GetProcesses())
             {
@@ -72,6 +88,7 @@
             Predicate<ProcContainer> predicate = new Predicate<ProcContainer>(IsNotValidProcess);
             proc_list.RemoveAll(predicate);
             ValidProcessesForPlugin = proc_list;
+            logger.SetLoggingFlags(flags); // reset flags
         }
 
         protected abstract bool IsNotValidProcess(ProcContainer p);

 

  ViewVC Help
Powered by ViewVC 1.1.22