Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

perfmsg.h

Go to the documentation of this file.
00001 /*++ BUILD Version: 0001 00002 00003 Copyright (c) 1985 - 1999, Microsoft Corporation 00004 00005 Module Name: perfmsg.h 00006 00007 Abstract: 00008 This file provides the macros and definitions used by the extensible 00009 counters for reporting events to the event logging facility 00010 00011 Revision History: 00012 00013 --*/ 00014 00015 #ifndef _PERFMSG_H_ 00016 #define _PERFMSG_H_ 00017 00018 // 00019 // Report error message ID's for Counters 00020 // 00021 00022 #define APP_NAME "perfuser" 00023 00024 // 00025 // The constant below defines how many (if any) messages will be reported 00026 // to the event logger. As the number goes up in value more and more events 00027 // will be reported. The purpose of this is to allow lots of messages during 00028 // development and debugging (e.g. a message level of 3) to a minimum of 00029 // messages (e.g. operational messages with a level of 1) or no messages if 00030 // message logging inflicts too much of a performance penalty. Right now 00031 // this is a compile time constant, but could later become a registry entry. 00032 // 00033 // Levels: LOG_NONE = No event log messages ever 00034 // LOG_USER = User event log messages (e.g. errors) 00035 // LOG_DEBUG = Minimum Debugging 00036 // LOG_VERBOSE = Maximum Debugging 00037 // 00038 00039 #define LOG_NONE 0 00040 #define LOG_USER 1 00041 #define LOG_DEBUG 2 00042 #define LOG_VERBOSE 3 00043 #define MESSAGE_LEVEL_DEFAULT LOG_USER 00044 00045 // define macros 00046 // 00047 // Format for event log calls without corresponding insertion strings is: 00048 // REPORT_xxx (message_value, message_level) 00049 // where: 00050 // xxx is the severity to be displayed in the event log 00051 // message_value is the numeric ID from above 00052 // message_level is the "filtering" level of error reporting 00053 // using the error levels above. 00054 // 00055 // if the message has a corresponding insertion string whose symbol conforms 00056 // to the format CONSTANT = numeric value and CONSTANT_S = string constant for 00057 // that message, then the 00058 // 00059 // REPORT_xxx_STRING (message_value, message_level) 00060 // 00061 // macro may be used. 00062 // 00063 // 00064 // REPORT_SUCCESS was intended to show Success in the error log, rather it 00065 // shows "N/A" so for now it's the same as information, though it could 00066 // (should) be changed in the future 00067 // 00068 00069 #define REPORT_SUCCESS(i,l) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \ 00070 0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE) 00071 00072 #define REPORT_INFORMATION(i,l) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \ 00073 0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE) 00074 00075 #define REPORT_WARNING(i,l) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_WARNING_TYPE, \ 00076 0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE) 00077 00078 #define REPORT_ERROR(i,l) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_ERROR_TYPE, \ 00079 0, i, (PSID)NULL, 0, 0, NULL, (PVOID)NULL) : FALSE) 00080 00081 #define REPORT_INFORMATION_DATA(i,l,d,s) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_INFORMATION_TYPE, \ 00082 0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE) 00083 00084 #define REPORT_WARNING_DATA(i,l,d,s) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_WARNING_TYPE, \ 00085 0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE) 00086 00087 #define REPORT_ERROR_DATA(i,l,d,s) (MESSAGE_LEVEL >= l ? ReportEvent (hEventLog, EVENTLOG_ERROR_TYPE, \ 00088 0, i, (PSID)NULL, 0, s, NULL, (PVOID)(d)) : FALSE) 00089 00090 // External Variables 00091 00092 extern HANDLE hEventLog; // handle to event log 00093 00094 extern DWORD dwLogUsers; // counter of event log using routines 00095 00096 extern DWORD MESSAGE_LEVEL; // event logging detail level 00097 00098 #endif //_PERFMSG_H_

Generated on Sat May 15 19:41:08 2004 for test by doxygen 1.3.7