LogPathDefine.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace WeChatCore.DefineClass
  8. {
  9. public class LogPathDefine
  10. {
  11. /// <summary>
  12. /// 获取根路径
  13. /// </summary>
  14. /// <returns></returns>
  15. public static string GetLogDirectory()
  16. {
  17. string DirectoryPath = Environment.CurrentDirectory + "\\Log";
  18. if (!Directory.Exists(DirectoryPath))
  19. Directory.CreateDirectory(DirectoryPath);
  20. return DirectoryPath;
  21. }
  22. /// <summary>
  23. /// 系统日志
  24. /// </summary>
  25. public static string SystemLogPath
  26. {
  27. get
  28. {
  29. return GetLogDirectory() + "\\System.log";
  30. }
  31. }
  32. /// <summary>
  33. /// 微信正常日志
  34. /// </summary>
  35. public static string WeChatLogPath
  36. {
  37. get
  38. {
  39. return GetLogDirectory() + "\\WeChat.log";
  40. }
  41. }
  42. /// <summary>
  43. /// 微信正常日志
  44. /// </summary>
  45. public static string WeChatErrorLogPath
  46. {
  47. get
  48. {
  49. return GetLogDirectory() + "\\WeChatError.log";
  50. }
  51. }
  52. /// <summary>
  53. /// 系统异常日志
  54. /// </summary>
  55. public static string ExceptionLogPath
  56. {
  57. get
  58. {
  59. return GetLogDirectory() + "\\Exception.log";
  60. }
  61. }
  62. /// <summary>
  63. /// 微信群日志
  64. /// </summary>
  65. public static string WeChatGrouplogPath
  66. {
  67. get
  68. {
  69. return GetLogDirectory() + "\\WeChatGroup.log";
  70. }
  71. }
  72. }
  73. }