ETWLogger Class Reference

Class for ETW logging. More...

Inherits Simba::Support::ILogger.

List of all members.

Public Member Functions

 ETWLogger (const GUID &in_publisherGuid)
 Constructor.
virtual const EVENT_DESCRIPTOR & GetDebugEventDescriptor () const
 Gets the Debug event descriptor.
virtual const EVENT_DESCRIPTOR & GetErrorEventDescriptor () const
 Gets the Error event descriptor.
virtual const EVENT_DESCRIPTOR & GetFatalEventDescriptor () const
 Gets the Fatal event descriptor.
virtual const EVENT_DESCRIPTOR & GetInfoEventDescriptor () const
 Gets the Info event descriptor.
const simba_string & GetLocale () const
 Gets the locale for this logger.
virtual LogLevel GetLogLevel () const
 Gets the current LogLevel.
virtual const EVENT_DESCRIPTOR & GetTraceEventDescriptor () const
 Gets the Trace event descriptor.
virtual const EVENT_DESCRIPTOR & GetWarnEventDescriptor () const
 Gets the Warn event descriptor.
virtual void LogDebug (const simba_char *const in_namespace, const simba_char *const in_className, const simba_char *const in_functionName, const simba_char *const in_messageFormat,...)
 If the log level is greater than or equal to DEBUG, log the message.
virtual void LogError (const simba_char *const in_namespace, const simba_char *const in_className, const simba_char *const in_functionName, const simba_char *const in_messageFormat,...)
 If the log level is greater than or equal to ERROR, log the message.
virtual void LogError (const simba_char *const in_namespace, const simba_char *const in_className, const simba_char *const in_functionName, const ErrorException &in_exception)
 If the log level is greater than or equal to ERROR, log the message.
virtual void LogFatal (const simba_char *const in_namespace, const simba_char *const in_className, const simba_char *const in_functionName, const simba_char *const in_messageFormat,...)
 If the log level is greater than or equal to FATAL, log the message.
virtual void LogFunctionEntrance (const simba_char *const in_namespace, const simba_char *const in_className, const simba_char *const in_functionName)
 If the log level is greater than or equal to DEBUG, log the message.
virtual void LogInfo (const simba_char *const in_namespace, const simba_char *const in_className, const simba_char *const in_functionName, const simba_char *const in_messageFormat,...)
 If the log level is greater than or equal to INFO, log the message.
virtual void LogTrace (const simba_char *const in_namespace, const simba_char *const in_className, const simba_char *const in_functionName, const simba_char *const in_messageFormat,...)
 If the log level is greater than or equal to TRACE, log the message, then log a stack trace.
virtual void LogWarning (const simba_char *const in_namespace, const simba_char *const in_className, const simba_char *const in_functionName, const simba_char *const in_messageFormat,...)
 If the log level is greater than or equal to WARNING, log the message.
void SetActivityId (const simba_wstring &in_activityId)
 Sets a new activity identifier for this Logger.
void SetLocale (const simba_string &in_locale)
 Sets the Locale for this logger.
virtual void SetLogLevel (LogLevel in_logLevel)
 Sets a new LogLevel for this logger.
virtual void SetLogNamespace (const simba_string &in_namespace)
 Sets a new LogLevel for this logger.
virtual ~ETWLogger ()
 Destructor.

Protected Member Functions

bool IsInLevel (LogLevel in_level)
 Checks if the level provided in the log request is within the acceptable level.
bool IsInNamespace (const simba_char *const in_namespace)
 Checks if the namespace provided in the log request is within the acceptable namespace.
virtual void LogLine (const EVENT_DESCRIPTOR &in_eventDescriptor, const simba_char *in_namespace, const simba_char *in_className, const simba_char *in_functionName, const simba_char *in_messageFormat, va_list &in_varArgs)
 Formats and writes the given log message.
virtual void LogLineVarArgs (const EVENT_DESCRIPTOR &in_eventDescriptor, const simba_char *in_namespace, const simba_char *in_className, const simba_char *in_functionName, const simba_char *in_messageFormat,...)
 Formats and writes the given log message.

Detailed Description

Class for ETW logging.

This class is logger implementation that outputs its messages to the Windows Event Viewer. Therefore it's only supported on Windows. It supports only one Provider.


Constructor & Destructor Documentation

ETWLogger ( const GUID &  in_publisherGuid  )  [explicit]

Constructor.

Parameters:
in_publisherGuid The GUID for the publisher to trace. (NOT OWN)
virtual ~ETWLogger (  )  [virtual]

Destructor.


Member Function Documentation

virtual const EVENT_DESCRIPTOR& GetDebugEventDescriptor (  )  const [virtual]

Gets the Debug event descriptor.

Returns:
the Debug event descriptor.
virtual const EVENT_DESCRIPTOR& GetErrorEventDescriptor (  )  const [virtual]

Gets the Error event descriptor.

Returns:
the Error event descriptor.
virtual const EVENT_DESCRIPTOR& GetFatalEventDescriptor (  )  const [virtual]

Gets the Fatal event descriptor.

Returns:
the Fatal event descriptor.
virtual const EVENT_DESCRIPTOR& GetInfoEventDescriptor (  )  const [virtual]

Gets the Info event descriptor.

Returns:
the Info event descriptor.
const simba_string& GetLocale (  )  const [virtual]

Gets the locale for this logger.

This function is not meant to be overridden.

Returns:
The locale for this logger.

Implements ILogger.

virtual LogLevel GetLogLevel (  )  const [virtual]

Gets the current LogLevel.

Returns:
The current LogLevel.

Implements ILogger.

virtual const EVENT_DESCRIPTOR& GetTraceEventDescriptor (  )  const [virtual]

Gets the Trace event descriptor.

Returns:
the Trace event descriptor.
virtual const EVENT_DESCRIPTOR& GetWarnEventDescriptor (  )  const [virtual]

Gets the Warn event descriptor.

Returns:
the Warn event descriptor.
bool IsInLevel ( LogLevel  in_level  )  [inline, protected]

Checks if the level provided in the log request is within the acceptable level.

Parameters:
in_level The level of the function attempting to log.
Returns:
True if the request to log is within the level being logged; false otherwise.
bool IsInNamespace ( const simba_char *const   in_namespace  )  [inline, protected]

Checks if the namespace provided in the log request is within the acceptable namespace.

Parameters:
in_namespace The namespace of the function attempting to log. (NOT OWN)
Returns:
True if the request to log is within the namespace being logged; false otherwise.
virtual void LogDebug ( const simba_char *const   in_namespace,
const simba_char *const   in_className,
const simba_char *const   in_functionName,
const simba_char *const   in_messageFormat,
  ... 
) [virtual]

If the log level is greater than or equal to DEBUG, log the message.

Initializes logger, if it hasn't already.

Parameters:
in_namespace The namespace of the function attempting to log. (NOT OWN)
in_className The name of the class to log. (NOT OWN)
in_functionName The name of the function to log. (NOT OWN)
in_messageFormat The message to log. May contain printf style conversion chars. (NOT OWN)
... Variable arguments list for printf style conversions.
virtual void LogError ( const simba_char *const   in_namespace,
const simba_char *const   in_className,
const simba_char *const   in_functionName,
const simba_char *const   in_messageFormat,
  ... 
) [virtual]

If the log level is greater than or equal to ERROR, log the message.

Initializes logger, if it hasn't already.

Parameters:
in_namespace The namespace of the function attempting to log. (NOT OWN)
in_className The name of the class to log. (NOT OWN)
in_functionName The name of the function to log. (NOT OWN)
in_messageFormat The message to log. May contain printf style conversion chars. (NOT OWN)
... Variable arguments list for printf style conversions.
virtual void LogError ( const simba_char *const   in_namespace,
const simba_char *const   in_className,
const simba_char *const   in_functionName,
const ErrorException in_exception 
) [virtual]

If the log level is greater than or equal to ERROR, log the message.

Initializes logger, if it hasn't already.

Parameters:
in_namespace The namespace of the function attempting to log. (NOT OWN)
in_className The name of the class to log. (NOT OWN)
in_functionName The name of the function to log. (NOT OWN)
in_exception The exception to log.
virtual void LogFatal ( const simba_char *const   in_namespace,
const simba_char *const   in_className,
const simba_char *const   in_functionName,
const simba_char *const   in_messageFormat,
  ... 
) [virtual]

If the log level is greater than or equal to FATAL, log the message.

Initializes logger, if it hasn't already.

Parameters:
in_namespace The namespace of the function attempting to log. (NOT OWN)
in_className The name of the class to log. (NOT OWN)
in_functionName The name of the function to log. (NOT OWN)
in_messageFormat The message to log. May contain printf style conversion chars. (NOT OWN)
... Variable arguments list for printf style conversions.
virtual void LogFunctionEntrance ( const simba_char *const   in_namespace,
const simba_char *const   in_className,
const simba_char *const   in_functionName 
) [virtual]

If the log level is greater than or equal to DEBUG, log the message.

The message will be something similar to: <fileName><functionName> +++++ enter +++++

Initializes logger, if it hasn't already.

Parameters:
in_namespace The namespace of the function attempting to log. (NOT OWN)
in_className The name of the class to log. (NOT OWN)
in_functionName The name of the function to log. (NOT OWN)
virtual void LogInfo ( const simba_char *const   in_namespace,
const simba_char *const   in_className,
const simba_char *const   in_functionName,
const simba_char *const   in_messageFormat,
  ... 
) [virtual]

If the log level is greater than or equal to INFO, log the message.

Initializes logger, if it hasn't already.

Parameters:
in_namespace The namespace of the function attempting to log. (NOT OWN)
in_className The name of the class to log. (NOT OWN)
in_functionName The name of the function to log. (NOT OWN)
in_messageFormat The message to log. May contain printf style conversion chars. (NOT OWN)
... Variable arguments list for printf style conversions.
virtual void LogLine ( const EVENT_DESCRIPTOR &  in_eventDescriptor,
const simba_char *  in_namespace,
const simba_char *  in_className,
const simba_char *  in_functionName,
const simba_char *  in_messageFormat,
va_list &  in_varArgs 
) [protected, virtual]

Formats and writes the given log message.

The derived class can re-implement this function to change the formatting.

Parameters:
in_eventDescriptor The type of event to raise.
in_namespace The namespace of the function attempting to log. (NOT OWN)
in_className The name of the class to log. (NOT OWN)
in_functionName The name of the function to log. (NOT OWN)
in_messageFormat The format of the message. (NOT OWN)
in_varArgs The variable argument list for the message.
virtual void LogLineVarArgs ( const EVENT_DESCRIPTOR &  in_eventDescriptor,
const simba_char *  in_namespace,
const simba_char *  in_className,
const simba_char *  in_functionName,
const simba_char *  in_messageFormat,
  ... 
) [protected, virtual]

Formats and writes the given log message.

This method forwards its arguments to LogLine.

Parameters:
in_eventDescriptor The type of event to raise.
in_namespace The namespace of the function attempting to log. (NOT OWN)
in_className The name of the class to log. (NOT OWN)
in_functionName The name of the function to log. (NOT OWN)
in_messageFormat The format of the message. (NOT OWN)
... The variable argument list for the message.
virtual void LogTrace ( const simba_char *const   in_namespace,
const simba_char *const   in_className,
const simba_char *const   in_functionName,
const simba_char *const   in_messageFormat,
  ... 
) [virtual]

If the log level is greater than or equal to TRACE, log the message, then log a stack trace.

Initializes logger, if it hasn't already.

Parameters:
in_namespace The namespace of the function attempting to log. (NOT OWN)
in_className The name of the class to log. (NOT OWN)
in_functionName The name of the function to log. (NOT OWN)
in_messageFormat The message to log. May contain printf style conversion chars. (NOT OWN)
... Variable arguments list for printf style conversions.
virtual void LogWarning ( const simba_char *const   in_namespace,
const simba_char *const   in_className,
const simba_char *const   in_functionName,
const simba_char *const   in_messageFormat,
  ... 
) [virtual]

If the log level is greater than or equal to WARNING, log the message.

Initializes logger, if it hasn't already.

Parameters:
in_namespace The namespace of the function attempting to log. (NOT OWN)
in_className The name of the class to log. (NOT OWN)
in_functionName The name of the function to log. (NOT OWN)
in_messageFormat The message to log. May contain printf style conversion chars. (NOT OWN)
... Variable arguments list for printf style conversions.
void SetActivityId ( const simba_wstring in_activityId  )  [inline]

Sets a new activity identifier for this Logger.

Parameters:
in_activityId The new activity identifier.
void SetLocale ( const simba_string &  in_locale  ) 

Sets the Locale for this logger.

If the locale is not set, then the driver-wide locale is used.

This function is not meant to be overridden.

Parameters:
in_locale The locale for this logger.
virtual void SetLogLevel ( LogLevel  in_logLevel  )  [virtual]

Sets a new LogLevel for this logger.

Parameters:
in_logLevel The new LogLevel.

Implements ILogger.

virtual void SetLogNamespace ( const simba_string &  in_namespace  )  [virtual]

Sets a new LogLevel for this logger.

Parameters:
in_namespace The new logging namespace.

The documentation for this class was generated from the following file:

Generated on Wed May 17 14:21:15 2017 for SimbaEngine 10.1.3.1011 by simba