CityLogger.cs 726 B

12345678910111213141516171819202122232425262728
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using ConfigReader;
  5. namespace Logger
  6. {
  7. public enum LogLevel { DEBUG, INFO, WARNING, ERROR}
  8. public static class CityLogger
  9. {
  10. private static LogLevel LogLevel = LogLevel.DEBUG;
  11. public static void Log(string s, LogLevel level)
  12. {
  13. if (level >= LogLevel)
  14. Debug.Log(s);
  15. }
  16. public static void LogWarning(string s)
  17. {
  18. if (LogLevel >= LogLevel.WARNING)
  19. Debug.LogWarning(s);
  20. }
  21. public static void LogError(string s)
  22. {
  23. if (LogLevel >= LogLevel.ERROR)
  24. Debug.LogWarning(s);
  25. }
  26. }
  27. }