SmartLog.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace Vinno.vCloud.FIS.CrossPlatform.Windows.RTMPSDK
  4. {
  5. /// <summary>
  6. /// NTSmartLog 的摘要说明。
  7. /// </summary>
  8. public class NTSmartLog_x64
  9. {
  10. /*
  11. 设置日志目录,Windows平台请设置宽字符,比如"D:\\xxx\gg"
  12. */
  13. [DllImport(@"x64\SmartLog.dll")]
  14. public static extern UInt32 NT_SL_SetPath([MarshalAs(UnmanagedType.LPWStr)] String path);
  15. /*
  16. 设置日志等级,level请参考SL_LOG_LEVEL
  17. */
  18. [DllImport(@"x64\SmartLog.dll")]
  19. public static extern UInt32 NT_SL_SetLevel(UInt32 level);
  20. /*
  21. 将缓冲全部写入
  22. */
  23. [DllImport(@"x64\SmartLog.dll")]
  24. public static extern UInt32 NT_SL_Flush();
  25. /*
  26. 万能接口, 设置参数, 大多数问题, 这些接口都能解决
  27. */
  28. [DllImport(@"x64\SmartLog.dll")]
  29. public static extern UInt32 NT_SL_SetParam(UInt32 id, IntPtr pData);
  30. /*
  31. 万能接口, 得到参数, 大多数问题,这些接口都能解决
  32. */
  33. [DllImport(@"x64\SmartLog.dll")]
  34. public static extern UInt32 NT_SL_GetParam(UInt32 id, IntPtr pData);
  35. }
  36. public class NTSmartLog_x86
  37. {
  38. /*
  39. 设置日志目录,Windows平台请设置宽字符,比如"D:\\xxx\gg"
  40. */
  41. [DllImport(@"x86\SmartLog.dll")]
  42. public static extern UInt32 NT_SL_SetPath([MarshalAs(UnmanagedType.LPWStr)] String path);
  43. /*
  44. 设置日志等级,level请参考SL_LOG_LEVEL
  45. */
  46. [DllImport(@"x86\SmartLog.dll")]
  47. public static extern UInt32 NT_SL_SetLevel(UInt32 level);
  48. /*
  49. 将缓冲全部写入
  50. */
  51. [DllImport(@"x86\SmartLog.dll")]
  52. public static extern UInt32 NT_SL_Flush();
  53. /*
  54. 万能接口, 设置参数, 大多数问题, 这些接口都能解决
  55. */
  56. [DllImport(@"x86\SmartLog.dll")]
  57. public static extern UInt32 NT_SL_SetParam(UInt32 id, IntPtr pData);
  58. /*
  59. 万能接口, 得到参数, 大多数问题,这些接口都能解决
  60. */
  61. [DllImport(@"x86\SmartLog.dll")]
  62. public static extern UInt32 NT_SL_GetParam(UInt32 id, IntPtr pData);
  63. }
  64. }