LogUtil.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using UnityEngine;
  2. namespace GFGGame
  3. {
  4. public static class LogUtil
  5. {
  6. public static void LogEditor(string content)
  7. {
  8. #if UNITY_EDITOR
  9. Debug.Log($"editor log : {content}");
  10. #endif
  11. }
  12. public static void LogFormatEditor(string content, params object[] args)
  13. {
  14. #if UNITY_EDITOR
  15. Debug.LogFormat($"editor log : {content}", args);
  16. #endif
  17. }
  18. public static void LogWarningEditor(string content)
  19. {
  20. #if UNITY_EDITOR
  21. Debug.LogWarning($"editor log : {content}");
  22. #endif
  23. }
  24. public static void LogWarningFormatEditor(string content, params object[] args)
  25. {
  26. #if UNITY_EDITOR
  27. Debug.LogWarningFormat($"editor log : {content}", args);
  28. #endif
  29. }
  30. public static void LogDev(string content)
  31. {
  32. if (LauncherConfig.onDebug > 0 || LauncherConfig.ChannelId == (int)ChannelID.Test)
  33. {
  34. Debug.Log($"dev log : {content}");
  35. }
  36. }
  37. public static void LogFormatDev(string content, params object[] args)
  38. {
  39. if (LauncherConfig.onDebug > 0 || LauncherConfig.ChannelId == (int)ChannelID.Test)
  40. {
  41. Debug.LogFormat($"dev log : {content}", args);
  42. }
  43. }
  44. public static void LogWarningDev(string content)
  45. {
  46. if (LauncherConfig.onDebug > 0 || LauncherConfig.ChannelId == (int)ChannelID.Test)
  47. {
  48. Debug.LogWarning($"dev warning {content}");
  49. }
  50. }
  51. public static void LogWarningFormatDev(string content, params object[] args)
  52. {
  53. if (LauncherConfig.onDebug > 0 || LauncherConfig.ChannelId == (int)ChannelID.Test)
  54. {
  55. Debug.LogWarningFormat($"dev warning {content}", args);
  56. }
  57. }
  58. }
  59. }