ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater.PluginFramework/Core/ConfigPlugin.cs
(Generate patch)

Comparing trunk/RomCheater.PluginFramework/Core/ConfigPlugin.cs (file contents):
Revision 149 by william, Thu May 10 09:53:16 2012 UTC vs.
Revision 150 by william, Sun May 27 23:59:22 2012 UTC

--- 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 @@ namespace RomCheater.PluginFramework.Cor
         }
         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 @@ namespace RomCheater.PluginFramework.Cor
             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);