UnityLogger.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #if UNITY
  2. using System;
  3. namespace ET
  4. {
  5. public class UnityLogger: ILog
  6. {
  7. public void Trace(string msg)
  8. {
  9. UnityEngine.Debug.Log(msg);
  10. }
  11. public void Debug(string msg)
  12. {
  13. UnityEngine.Debug.Log(msg);
  14. }
  15. public void Info(string msg)
  16. {
  17. UnityEngine.Debug.Log(msg);
  18. }
  19. public void Warning(string msg)
  20. {
  21. UnityEngine.Debug.LogWarning(msg);
  22. }
  23. public void Error(string msg)
  24. {
  25. UnityEngine.Debug.LogError(msg);
  26. }
  27. public void Error(Exception e)
  28. {
  29. UnityEngine.Debug.LogException(e);
  30. }
  31. public void Trace(string message, params object[] args)
  32. {
  33. UnityEngine.Debug.LogFormat(message, args);
  34. }
  35. public void Warning(string message, params object[] args)
  36. {
  37. UnityEngine.Debug.LogWarningFormat(message, args);
  38. }
  39. public void Info(string message, params object[] args)
  40. {
  41. UnityEngine.Debug.LogFormat(message, args);
  42. }
  43. public void Debug(string message, params object[] args)
  44. {
  45. UnityEngine.Debug.LogFormat(message, args);
  46. }
  47. public void Error(string message, params object[] args)
  48. {
  49. UnityEngine.Debug.LogErrorFormat(message, args);
  50. }
  51. }
  52. }
  53. #endif