/[RomCheater]/trunk/Win32/Sojaner.MemoryScanner/MemoryProviers/BaseMemoryProvider.cs
ViewVC logotype

Diff of /trunk/Win32/Sojaner.MemoryScanner/MemoryProviers/BaseMemoryProvider.cs

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

--- trunk/Win32/Sojaner.MemoryScanner/MemoryProviers/BaseMemoryProvider.cs	2014/04/15 14:30:48	811
+++ trunk/Win32/Sojaner.MemoryScanner/MemoryProviers/BaseMemoryProvider.cs	2014/04/15 14:52:10	812
@@ -21,6 +21,7 @@
 using RomCheater.PluginFramework.Events;
 using ManagedWinapi;
 using RomCheater.Core;
+using Enterprise.Logging;
 
 namespace Sojaner.MemoryScanner.MemoryProviers
 {
@@ -60,7 +61,7 @@
         {
             if (isOpen)
             {
-                logger.Warn.WriteLine("Provider has already been opened.");
+                gLog.Warn.WriteLine("Provider has already been opened.");
                 return;
             }
             try
@@ -68,14 +69,14 @@
                 provider = new ProcessMemoryReader();
                 provider.ReadProcess = this.AcceptedProcess;
                 provider.OnBytesRead += new BaseEventHandler<OnBytesReadEventArgs>(provider_OnBytesRead);
-                if (provider.ReadProcess == null) { logger.Error.WriteLine("{0}.OpenProvider() Could not attach to process: {1}", "", this.GetType().Name, this.AcceptedProcess.ToString()); return; }
+                if (provider.ReadProcess == null) { gLog.Error.WriteLine("{0}.OpenProvider() Could not attach to process: {1}", "", this.GetType().Name, this.AcceptedProcess.ToString()); return; }
                 //provider.OpenProcess();
                 isOpen = true;
                 isClosed = false;
             }
             catch (Exception ex)
             {
-                logger.Error.WriteLine("Failed to open provider: {0}{1}", System.Environment.NewLine, ex.ToString());
+                gLog.Error.WriteLine("Failed to open provider: {0}{1}", System.Environment.NewLine, ex.ToString());
                 isOpen = false;
                 isClosed = true;
             }
@@ -86,16 +87,16 @@
         {
             if (isClosed)
             {
-                logger.Warn.WriteLine("Provider has already been closed.");
+                gLog.Warn.WriteLine("Provider has already been closed.");
                 return;
             }
             if (!isOpen)
             {
-                logger.Warn.WriteLine("Provider cannot be closed, it was never opened...attempting to open provider.");
+                gLog.Warn.WriteLine("Provider cannot be closed, it was never opened...attempting to open provider.");
                 OpenProvider();
                 if (!isOpen)
                 {
-                    logger.Warn.WriteLine("Could not open provider");
+                    gLog.Warn.WriteLine("Could not open provider");
                     return;
                 }
             }
@@ -110,7 +111,7 @@
             }
             catch (Exception ex)
             {
-                logger.Error.WriteLine("Failed to close provider: {0}{1}", System.Environment.NewLine, ex.ToString());
+                gLog.Error.WriteLine("Failed to close provider: {0}{1}", System.Environment.NewLine, ex.ToString());
                 isClosed = false;
                 if (isOpen)
                 {
@@ -139,7 +140,7 @@
                 catch (Exception ex)
                 {
                     if (LogError)
-                        logger.Error.WriteLine(ex.ToString());
+                        gLog.Verbose.Error.WriteLine(ex.ToString());
                     if (ThrowError)
                         throw ex;
                     return false;

 

  ViewVC Help
Powered by ViewVC 1.1.22