Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
4.4 KiB

  1. //+-------------------------------------------------------------------
  2. //
  3. // File: log.h
  4. //
  5. // Contents: Common definitions used by logsvr.cxx and log.cxx
  6. //
  7. // History: 18-Sep-90 DaveWi Initial Coding
  8. // 14-Oct-91 SarahJ added LOG_PASS_TXT etc
  9. // 31-Oct-91 SarahJ added MIN_LINE_HDR_LEN
  10. // 10-Feb-92 BryanT Merged logid.h with this file.
  11. // 16-Sep-92 SarahJ added STD and HUGESTRBUFSIZEe.
  12. //
  13. //--------------------------------------------------------------------
  14. #ifndef _LOGSVR_LOG_H_INCLUDED_
  15. #define _LOGSVR_LOG_H_INCLUDED_
  16. extern BOOL fDebugOn;
  17. #define SAME 0
  18. #define LOG_OPEN_PARMS 6 // # parms in LogOpen packet
  19. #define LOG_WRITE_PARMS 11 // # parms in LogWrote packet
  20. #define LINE_HDR_LEN 8 // # bytes at beginning of log file data
  21. // line; must be greater than 3
  22. #define MIN_LINE_HDR_LEN 4 // Minimum length that the hdr
  23. // can be. ie n:<len>:
  24. #define STDSTRBUFSIZ 1024 // Default length of a formatted
  25. // string to be sent to the log file
  26. #define HUGESTRBUFSIZ 32767 // Max len (incl null) of a formated
  27. // string to be sent to the log file
  28. // String logged if output > 32K
  29. #define STR_TRUNCATION \
  30. "\n **** OUTPUT TRUNCATED **** \n\n"
  31. #define wSTR_TRUNCATION \
  32. L"\n **** OUTPUT TRUNCATED **** \n\n"
  33. #define STR_TRUNC_LEN 50
  34. #define SLASH '\\' // File name component sep
  35. #define NULLTERM '\0' // String terminating null
  36. #define wSLASH L'\\' // File name component sep
  37. #define wNULLTERM L'\0' // String terminating null
  38. #define INVALID_PARAM_COUNT (unsigned short)65000 // Invalid # params in packet
  39. #define INVALID_API (unsigned short)65001 // Invalid API name in packet
  40. #define CORRUPT_LOG_FILE (unsigned short)65002 // Log file is corrupted
  41. //
  42. // These next 3 defines are used internally by the logging code.
  43. //
  44. #define API_TERMINATE "TRPCLogServerStop"
  45. #define API_OPENLOGFILE "TRPCOpenLogFile"
  46. #define API_WRITETOFILE "TRPCWriteToLogFile"
  47. #define wAPI_TERMINATE L"TRPCLogServerStop"
  48. #define wAPI_OPENLOGFILE L"TRPCOpenLogFile"
  49. #define wAPI_WRITETOFILE L"TRPCWriteToLogFile"
  50. //
  51. // Registered name of logsrvr. This is the name used, in the logging server,
  52. // to register the logging server with Mailtrck
  53. //
  54. #define LOGSRVR_OBJECT_NAME "LOGSVR"
  55. #define wLOGSRVR_OBJECT_NAME L"LOGSVR"
  56. //
  57. // Text strings for status fields
  58. //
  59. #define LOG_PASS_TXT "VAR_PASS"
  60. #define LOG_FAIL_TXT "VAR_FAIL"
  61. #define LOG_ABORT_TXT "VAR_ABORT"
  62. #define LOG_WARN_TXT "WARNING"
  63. #define LOG_INFO_TXT "INFO"
  64. #define LOG_START_TXT "START"
  65. #define LOG_DONE_TXT "DONE"
  66. #define wLOG_PASS_TXT L"VAR_PASS"
  67. #define wLOG_FAIL_TXT L"VAR_FAIL"
  68. #define wLOG_ABORT_TXT L"VAR_ABORT"
  69. #define wLOG_WARN_TXT L"WARN"
  70. #define wLOG_INFO_TXT L"INFO"
  71. #define wLOG_START_TXT L"START"
  72. #define wLOG_DONE_TXT L"DONE"
  73. //
  74. // LOG FILE LINE IDENTIFIERS:
  75. // One of these is the first char in every line in the raw log file.
  76. // These are for parsing command line parameters, so no WCHAR required.
  77. //
  78. #define LOG_EVENTS 'e' // # events in log file
  79. #define LOG_TEST_NAME 'n' // Name of the test
  80. #define LOG_TEST_TIME 't' // Time test logging started
  81. #define LOG_TESTER 'u' // User running the test
  82. #define LOG_SERVER 's' // Logging server's name
  83. #define LOG_EVENT_NUM 'E' // Event's sequential # in log
  84. #define LOG_EVENT_TIME 'T' // Time the event happened
  85. #define LOG_MACHINE 'M' // Machine sending log data
  86. #define LOG_OBJECT 'O' // Name of logging object
  87. #define LOG_VARIATION 'V' // Variation number
  88. #define LOG_STATUS 'S' // Logged status
  89. #define LOG_STRING 'Z' // String data
  90. #define LOG_BINARY 'B' // Binary data
  91. // Needed to initialize va_list types to NULL - MIPS and ALPHA are
  92. // not ANSI-compatible wrt va_end
  93. //
  94. #ifdef _M_ALPHA
  95. #define LOG_VA_NULL {NULL, 0}
  96. #else
  97. #define LOG_VA_NULL NULL
  98. #endif
  99. #endif // _LOGSVR_LOG_H_INCLUDED_