Log.cs 561 B

12345678910111213141516171819202122232425262728
  1. using NLog;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace SMP.Common.Log
  8. {
  9. public class Log
  10. {
  11. private static Logger _logger;
  12. static Log()
  13. {
  14. _logger = NLog.LogManager.GetLogger("common");
  15. }
  16. public static void Info(string message)
  17. {
  18. _logger.Info(message);
  19. }
  20. public static void Error(Exception ex, string message)
  21. {
  22. _logger.Error(ex, message);
  23. }
  24. }
  25. }