Logger.cs 930 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace bbiwarg.Utility
  7. {
  8. public enum LogSubject
  9. {
  10. None = 0,
  11. FingerDetector = 1,
  12. FingerTracker = 2,
  13. HandDetector = 4,
  14. PalmDetector = 8,
  15. TouchDetector = 16,
  16. TouchTracker = 32,
  17. TUIOServer = 64,
  18. Timer = 128,
  19. TouchEvents = 256,
  20. VideoControls = 512
  21. }
  22. static class Logger
  23. {
  24. public static int CurrentFrame { get; set; }
  25. public static void log(string message, LogSubject subject)
  26. {
  27. if (Constants.LogLevel.HasFlag(subject))
  28. Console.WriteLine("Frame: " + CurrentFrame + "\t" + message);
  29. }
  30. public static void clear(LogSubject subject) {
  31. if (Constants.LogLevel.HasFlag(subject))
  32. Console.Clear();
  33. }
  34. }
  35. }