Просмотр исходного кода

added frame number to logger output

Alexander Hendrich 11 лет назад
Родитель
Сommit
e7a221bcff
2 измененных файлов с 4 добавлено и 1 удалено
  1. 3 1
      bbiwarg/Utility/Logger.cs
  2. 1 0
      bbiwarg/VideoHandle.cs

+ 3 - 1
bbiwarg/Utility/Logger.cs

@@ -20,10 +20,12 @@ namespace bbiwarg.Utility
     }
     static class Logger
     {
+        public static int CurrentFrame { get; set; }
+
         public static void log(string message, LogSubject subject)
         {
             if (Constants.LogLevel.HasFlag(subject))
-                Console.WriteLine(message);
+                Console.WriteLine("Frame: " + CurrentFrame + "\t" + message);
         }
     }
 }

+ 1 - 0
bbiwarg/VideoHandle.cs

@@ -128,6 +128,7 @@ namespace bbiwarg
 
         private void processFrameUpdate()
         {
+            Logger.CurrentFrame = CurrentFrame;
             bool newStarted = (lastFrame - CurrentFrame >= 20);
             Timer.start("processFrameUpdate");