LOG.cs 1.5 KB

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