ExtentionMethod.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using Newtonsoft.Json;
  2. using NLog;
  3. using RestSharp;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Configuration;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Security.Cryptography.X509Certificates;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using System.Xml.Serialization;
  13. namespace WayneCloud.Models
  14. {
  15. public static class ExtentionMethod
  16. {
  17. private static readonly NLog.Logger Logger = NLog.LogManager.GetLogger("Main");
  18. //在网站根目录下创建日志目录
  19. /**
  20. * 向日志文件写入调试信息
  21. * @param className 类名
  22. * @param content 写入内容
  23. */
  24. public static void Debug(string className, string content)
  25. {
  26. Logger.Debug(className + ": " + content);
  27. }
  28. /**
  29. * 向日志文件写入运行时信息
  30. * @param className 类名
  31. * @param content 写入内容
  32. */
  33. public static void Info(string className, string content)
  34. {
  35. Logger.Info(className + ": " + content);
  36. }
  37. /**
  38. * 向日志文件写入出错信息
  39. * @param className 类名
  40. * @param content 写入内容
  41. */
  42. public static void Error(string className, string content)
  43. {
  44. Logger.Error(className + ": " + content);
  45. }
  46. }
  47. }