UnityLogger.cs 1.4 KB

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