/[RomCheater]/trunk/RomCheater.Logging/logger.cs
ViewVC logotype

Diff of /trunk/RomCheater.Logging/logger.cs

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

--- 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 @@
         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 @@
             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 @@
                 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

 

  ViewVC Help
Powered by ViewVC 1.1.22