|
|
1.1 ! root 1: /*++ BUILD Version: 0001 // Increment this if a change has global effects ! 2: ! 3: Copyright (c) 1992 Microsoft Corporation ! 4: ! 5: Module Name: ! 6: ! 7: perfmsg.h ! 8: ! 9: Abstract: ! 10: ! 11: This file provides the macros and definitions used by the extensible ! 12: counters for reporting events to the event logging facility ! 13: ! 14: Author: ! 15: ! 16: Bob Watson (a-robw) 5 Oct 92 ! 17: ! 18: Revision History: ! 19: ! 20: ! 21: --*/ ! 22: #ifndef _PERFMSG_H_ ! 23: #define _PERFMSG_H_ ! 24: // ! 25: // Report error message ID's for Counters ! 26: // ! 27: ! 28: #define APP_NAME "vgactrs" ! 29: ! 30: // ! 31: // The constant below defines how many (if any) messages will be reported ! 32: // to the event logger. As the number goes up in value more and more events ! 33: // will be reported. The purpose of this is to allow lots of messages during ! 34: // development and debugging (e.g. a message level of 3) to a minimum of ! 35: // messages (e.g. operational messages with a level of 1) or no messages if ! 36: // message logging inflicts too much of a performance penalty. Right now ! 37: // this is a compile time constant, but could later become a registry entry. ! 38: // ! 39: // Levels: LOG_NONE = No event log messages ever ! 40: // LOG_USER = User event log messages (e.g. errors) ! 41: // LOG_DEBUG = Minimum Debugging ! 42: // LOG_VERBOSE = Maximum Debugging ! 43: // ! 44: ! 45: #define LOG_NONE 0 ! 46: #define LOG_USER 1 ! 47: #define LOG_DEBUG 2 ! 48: #define LOG_VERBOSE 3 ! 49: ! 50: #define MESSAGE_LEVEL_DEFAULT LOG_USER ! 51: ! 52: // define macros ! 53: // ! 54: // Format for event log calls without corresponding insertion strings is: ! 55: // REPORT_xxx (message_value, message_level) ! 56: // where: ! 57: // xxx is the severity to be displayed in the event log ! 58: // message_value is the numeric ID from above ! 59: // message_level is the "filtering" level of error reporting ! 60: // using the error levels above. ! 61: // ! 62: // if the message has a corresponding insertion string whose symbol conforms ! 63: // to the format CONSTANT = numeric value and CONSTANT_S = string constant for ! 64: // that message, then the ! 65: // ! 66: // REPORT_xxx_STRING (message_value, message_level) ! 67: // ! 68: // macro may be used. ! 69: // ! 70: ! 71: // ! 72: // REPORT_SUCCESS was intended to show Success in the error log, rather it ! 73: // shows "N/A" so for now it's the same as information, though it could ! 74: // (should) be changed in the future ! 75: // ! 76: ! 77: ! 78: #define REPORT_SUCCESS(i,l) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \ ! 79: 0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE) ! 80: ! 81: #define REPORT_INFORMATION(i,l) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \ ! 82: 0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE) ! 83: ! 84: #define REPORT_WARNING(i,l) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_WARNING_TYPE, \ ! 85: 0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE) ! 86: ! 87: #define REPORT_ERROR(i,l) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_ERROR_TYPE, \ ! 88: 0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE) ! 89: ! 90: #define REPORT_INFORMATION_DATA(i,l,d,s) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \ ! 91: 0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE) ! 92: ! 93: #define REPORT_WARNING_DATA(i,l,d,s) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_WARNING_TYPE, \ ! 94: 0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE) ! 95: ! 96: #define REPORT_ERROR_DATA(i,l,d,s) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_ERROR_TYPE, \ ! 97: 0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE) ! 98: ! 99: // External Variables ! 100: ! 101: extern HANDLE hEventLog; // handle to event log ! 102: extern DWORD dwLogUsers; // counter of event log using routines ! 103: extern DWORD MESSAGE_LEVEL; // event logging detail level ! 104: ! 105: #endif //_PERFMSG_H_
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.