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

Comparing trunk/RomCheater.Logging/logger.cs (file contents):
Revision 390 by william, Tue Jun 5 13:27:40 2012 UTC vs.
Revision 391 by william, Wed Jun 20 10:02:14 2012 UTC

--- trunk/RomCheater.Logging/logger.cs	2012/06/20 09:46:49	390
+++ trunk/RomCheater.Logging/logger.cs	2012/06/20 10:02:14	391
@@ -128,8 +128,9 @@ namespace RomCheater.Logging
         public static EnumNameValuePair<TValue> VERBOSE_DEBUG = new EnumNameValuePair<TValue>("VERBOSE_DEBUG", Binary<TValue>.ToValue("01000"));
         public static EnumNameValuePair<TValue> VERBOSE_ERROR = new EnumNameValuePair<TValue>("VERBOSE_ERROR", Binary<TValue>.ToValue("10000"));
         public static EnumNameValuePair<TValue> WARN = new EnumNameValuePair<TValue>("WARN", Binary<TValue>.ToValue("100000"));
+        public static EnumNameValuePair<TValue> PROFILER = new EnumNameValuePair<TValue>("PROFILER", Binary<TValue>.ToValue("1000000"));
         public static EnumNameValuePair<TValue> DEFAULT = new EnumNameValuePair<TValue>("DEFAULT", EnumNameValuePair<TValue>.bitwise_or(INFO, DEBUG, ERROR, WARN));
-        public static EnumNameValuePair<TValue> ALL = new EnumNameValuePair<TValue>("ALL", EnumNameValuePair<TValue>.bitwise_or(DEFAULT, VERBOSE_DEBUG, VERBOSE_ERROR));
+        public static EnumNameValuePair<TValue> ALL = new EnumNameValuePair<TValue>("ALL", EnumNameValuePair<TValue>.bitwise_or(DEFAULT, VERBOSE_DEBUG, VERBOSE_ERROR, PROFILER));
         #endregion
 
         protected static Dictionary<TValue, EnumNameValuePair<TValue>> value_pairs;
@@ -224,6 +225,12 @@ namespace RomCheater.Logging
             public static void Write(string format, params object[] args) { if (logging_flags.HasFlag(loggerflags.VERBOSE_ERROR)) { xlogger.Write(CreateNewFormat(format), args); } }
             public static void WriteLine(string format, params object[] args) { if (logging_flags.HasFlag(loggerflags.VERBOSE_ERROR)) { xlogger.WriteLine(CreateNewFormat(format), args); } }
         }
+        public static class Profiler
+        {
+            private static string CreateNewFormat(string format) { return "    " + CreateTimeStamp() + "(PROFILER) " + format; }
+            public static void Write(string format, params object[] args) { if (logging_flags.HasFlag(loggerflags.PROFILER)) { xlogger.Write(CreateNewFormat(format), args); } }
+            public static void WriteLine(string format, params object[] args) { if (logging_flags.HasFlag(loggerflags.PROFILER)) { xlogger.WriteLine(CreateNewFormat(format), args); } }
+        }
         #region Force logging
         public static class ForceLog
         {
@@ -251,6 +258,12 @@ namespace RomCheater.Logging
                 public static void Write(string format, params object[] args) { xlogger.Write(CreateNewFormat(format), args); }
                 public static void WriteLine(string format, params object[] args) { xlogger.WriteLine(CreateNewFormat(format), args); }
             }
+            public static class Profiler
+            {
+                private static string CreateNewFormat(string format) { return "    " + CreateTimeStamp() + "(FORCED PROFILER) " + format; }
+                public static void Write(string format, params object[] args) { xlogger.Write(CreateNewFormat(format), args); }
+                public static void WriteLine(string format, params object[] args) { xlogger.WriteLine(CreateNewFormat(format), args); }
+            }
         }
         #endregion
         #endregion