AudRecordLib
Defines | Functions
ETWEventFunctions.inl File Reference

Includes the common functions for ETW error reporting This file isn't compiled as normal, it's included by those who wish to use its error reporting. More...

#include "ETWEvents.h"

Defines

#define ODS_PRINT(format,...)

Functions

 C_ASSERT (sizeof(ETW_PROVIDER_GUID)==sizeof(GUID))
void RegisterEventProvider ()
void UnregisterEventProvider ()
void WriteEvent (LPCSTR pszFile, DWORD line, LPCSTR pszFunction, LPCSTR pszData, const EVENT_DESCRIPTOR &evDesc)
void LogDebugEvent (LPCSTR pszFile, DWORD line, LPCSTR pszFunction, LPCSTR pszData)
void LogSevereEvent (LPCSTR pszFile, DWORD line, LPCSTR pszFunction, LPCSTR pszData)

Detailed Description

Includes the common functions for ETW error reporting This file isn't compiled as normal, it's included by those who wish to use its error reporting.


Define Documentation

#define ODS_PRINT (   format,
  ... 
)
Value:
{ \
                char buffer[300]; \
                LogFormat(buffer, __FUNCTION__ " " format, __VA_ARGS__); \
                OutputDebugStringA(buffer); \
        }

Formats format and any additional args using LogFormat() before outputting the result using OutputDebugStringA(). This is a macro so we can pass the variable args to LogFormat


Function Documentation

void LogDebugEvent ( LPCSTR  pszFile,
DWORD  line,
LPCSTR  pszFunction,
LPCSTR  pszData 
)

Creates a debug event in the log

The function is equivalent to calling WriteEvent with FunctionFailureDebug as the event descriptor, but only if the event is enabled by the log consumer

Parameters:
pszFilethe file in which the event occurred
lineThe line on which it occurred on
pszFunctionNarrow string containing the name of the function it occurred in
pszdataNarrow string containing any additional text
void LogSevereEvent ( LPCSTR  pszFile,
DWORD  line,
LPCSTR  pszFunction,
LPCSTR  pszData 
)

Creates a severe error event in the log

The function is equivalent to calling WriteEvent with FunctionError as the event descriptor, but only if the event is enabled by the log consumer

Parameters:
pszFilethe file in which the event occurred
lineThe line on which it occurred on
pszFunctionNarrow string containing the name of the function it occurred in
pszdataNarrow string containing any additional text
void RegisterEventProvider ( )

Registers a certain provider event source with ETW

It relies on a previously defined or existant ETW_PROVIDER_GUID value that contains the GUID of the provider.

void UnregisterEventProvider ( )

Unregisters a certain provider event source with ETW so it can no longer send events

void WriteEvent ( LPCSTR  pszFile,
DWORD  line,
LPCSTR  pszFunction,
LPCSTR  pszData,
const EVENT_DESCRIPTOR &  evDesc 
)

Send an event to ant listeners

Descriptors are created for each parameter passed into the event, before it is written using the supplied description

Parameters:
pszFilethe file in which the event occurred
lineThe line on which it occurred on
pszFunctionNarrow string containing the name of the function it occurred in
pszdataNarrow string containing any additional text
evDescDescription of the event to raise
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Defines