LOG.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Aitex.Core.RT.Log;
  6. namespace Aitex.Core.RT.Log
  7. {
  8. public static class LOG
  9. {
  10. public static ICommonLog InnerLogger { set; private get; }
  11. public static void Info(string message, bool isTraceOn=false)
  12. {
  13. if (InnerLogger != null)
  14. InnerLogger.Info(message, isTraceOn);
  15. }
  16. public static void Warning(string message)
  17. {
  18. if (InnerLogger != null)
  19. InnerLogger.Warning(message);
  20. }
  21. public static void Warning(string message, params object[] args)
  22. {
  23. if (InnerLogger != null)
  24. InnerLogger.Warning(string.Format(message, args));
  25. }
  26. public static void Error(string message)
  27. {
  28. if (InnerLogger != null)
  29. InnerLogger.Error(message);
  30. }
  31. public static void Warning(string message, Exception ex)
  32. {
  33. if (InnerLogger != null)
  34. InnerLogger.Warning(message, ex);
  35. }
  36. public static void Error(string message, Exception ex)
  37. {
  38. if (InnerLogger != null)
  39. InnerLogger.Error(message, ex);
  40. }
  41. public static void Write(Exception ex)
  42. {
  43. Error("", ex);
  44. }
  45. public static void Write(Exception ex, string message)
  46. {
  47. Error(message, ex);
  48. }
  49. public static void Write(string message)
  50. {
  51. Info(message);
  52. }
  53. }
  54. }