AgoraLog.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #if UNITY_EDITOR_WIN || UNITY_EDITOR_OSX || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_IOS || UNITY_ANDROID
  2. using UnityEngine;
  3. #elif NET40_OR_GREATER || NETCOREAPP2_0_OR_GREATER
  4. using System.Diagnostics;
  5. #endif
  6. namespace Agora.Rtc
  7. {
  8. internal class AgoraLog
  9. {
  10. private const string AgoraMsgTag = "[Agora]:";
  11. internal static void Log(string msg)
  12. {
  13. #if UNITY_EDITOR_WIN || UNITY_EDITOR_OSX || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_IOS || UNITY_ANDROID
  14. Debug.LogFormat("{0} {1}\n", AgoraMsgTag, msg);
  15. #endif
  16. #if NET40_OR_GREATER || NETCOREAPP2_0_OR_GREATER
  17. Debug.WriteLine("[Agora Log] {0} {1}\n", AgoraMsgTag, msg);
  18. #endif
  19. }
  20. internal static void LogWarning(string warningMsg)
  21. {
  22. #if UNITY_EDITOR_WIN || UNITY_EDITOR_OSX || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_IOS || UNITY_ANDROID
  23. Debug.LogWarningFormat("{0} {1}\n", AgoraMsgTag, warningMsg);
  24. #endif
  25. #if NET40_OR_GREATER || NETCOREAPP2_0_OR_GREATER
  26. Debug.WriteLine("[Agora Warning] {0} {1}\n", AgoraMsgTag, warningMsg);
  27. #endif
  28. }
  29. internal static void LogError(string errorMsg)
  30. {
  31. #if UNITY_EDITOR_WIN || UNITY_EDITOR_OSX || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_IOS || UNITY_ANDROID
  32. Debug.LogErrorFormat("{0} {1}\n", AgoraMsgTag, errorMsg);
  33. #endif
  34. #if NET40_OR_GREATER || NETCOREAPP2_0_OR_GREATER
  35. Debug.WriteLine("[Agora Error] {0} {1}\n", AgoraMsgTag, errorMsg);
  36. #endif
  37. }
  38. }
  39. }
  40. //#if NET40_OR_GREATER || NETCOREAPP2_0_OR_GREATER
  41. //namespace Agora.Rtc
  42. //{
  43. // internal class AgoraLog
  44. // {
  45. // private const string AgoraMsgTag = "[Agora]:";
  46. // internal static void Log(string msg)
  47. // {
  48. // Debug.WriteLine("[Agora Log] {0} {1}\n", AgoraMsgTag, msg);
  49. // }
  50. // internal static void LogWarning(string warningMsg)
  51. // {
  52. // Debug.WriteLine("[Agora Warning] {0} {1}\n", AgoraMsgTag, warningMsg);
  53. // }
  54. // internal static void LogError(string errorMsg)
  55. // {
  56. // Debug.WriteLine("[Agora Error] {0} {1}\n", AgoraMsgTag, errorMsg);
  57. // }
  58. // }
  59. //}
  60. //#endif