LogUtil.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. LauncherConfig.ChannelId == (int)ChannelID.DouYouTest)
  34. {
  35. Debug.Log($"dev log : {content}");
  36. }
  37. }
  38. public static void LogFormatDev(string content, params object[] args)
  39. {
  40. if (LauncherConfig.onDebug > 0 || LauncherConfig.ChannelId == (int)ChannelID.Test ||
  41. LauncherConfig.ChannelId == (int)ChannelID.DouYouTest)
  42. {
  43. Debug.LogFormat($"dev log : {content}", args);
  44. }
  45. }
  46. public static void LogWarningDev(string content)
  47. {
  48. if (LauncherConfig.onDebug > 0 || LauncherConfig.ChannelId == (int)ChannelID.Test ||
  49. LauncherConfig.ChannelId == (int)ChannelID.DouYouTest)
  50. {
  51. Debug.LogWarning($"dev warning {content}");
  52. }
  53. }
  54. public static void LogWarningFormatDev(string content, params object[] args)
  55. {
  56. if (LauncherConfig.onDebug > 0 || LauncherConfig.ChannelId == (int)ChannelID.Test ||
  57. LauncherConfig.ChannelId == (int)ChannelID.DouYouTest)
  58. {
  59. Debug.LogWarningFormat($"dev warning {content}", args);
  60. }
  61. }
  62. }
  63. }