PackLog.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using UnityEngine;
  3. namespace Pack
  4. {
  5. public static class PackLog
  6. {
  7. public static void Log(string message)
  8. {
  9. if (Application.isBatchMode)
  10. Debug.Log(PackConstant.TAG_START + message + PackConstant.TAG_END);
  11. else
  12. Debug.Log(message);
  13. }
  14. public static void LogError(string message)
  15. {
  16. if (Application.isBatchMode)
  17. Debug.LogError(PackConstant.TAG_ERROR_START + message + PackConstant.TAG_ERROR_END);
  18. else
  19. Debug.LogError(message);
  20. }
  21. public static void LogWarning(string message)
  22. {
  23. if (Application.isBatchMode)
  24. Debug.LogWarning(PackConstant.TAG_WARING_START + message + PackConstant.TAG_WARING_END);
  25. else
  26. Debug.LogWarning(message);
  27. }
  28. public static void LogException(Exception exception)
  29. {
  30. if (Application.isBatchMode)
  31. {
  32. Debug.LogError(PackConstant.TAG_EXCEPTION_START);
  33. Debug.LogException(exception);
  34. Debug.LogError(PackConstant.TAG_EXCEPTION_END);
  35. }
  36. else
  37. Debug.LogException(exception);
  38. }
  39. }
  40. }