DSILogger Class Reference

Base class for basic logging functionality. More...

Inherits Simba::Support::ILogger.

Inherited by DSIFileLogger.

List of all members.

Public Member Functions

virtual const simba_string & GetLocale () const
 Gets the locale for this logger.
virtual LogLevel GetLogLevel () const
 Gets the current LogLevel.
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.
virtual 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 ~DSILogger ()
 Destructor.

Static Public Member Functions

static const simba_char * ConvertLogLevelToCString (LogLevel in_logLevel)
 Converts a log level to a c-string.
static simba_string ConvertLogLevelToString (LogLevel in_logLevel)
 Converts a log level to a simba_string.
static LogLevel ConvertStringToLogLevel (const simba_wstring &in_wstring)
 Converts a string to a log level.
static LogLevel ConvertStringToLogLevel (const simba_string &in_string)
 Converts a string to a log level.

Protected Member Functions

 DSILogger (LogLevel in_logLevel, const simba_string &in_namespace, const simba_string &in_locale)
 Constructor.
 DSILogger (LogLevel in_logLevel, const simba_string &in_namespace)
 Constructor.
 DSILogger ()
 Default Constructor.
bool IsInLevel (LogLevel in_logLevel)
 Checks if the level provided in the log request is within the acceptable level.
bool IsInNamespace (const simba_char *in_namespace)
 Checks if the namespace provided in the log request is within the acceptable namespace.
virtual void LogLine (LogLevel in_logLevel, const simba_char *in_namespace, const simba_char *in_className, const simba_char *in_functionName, const simba_char *in_messageFormat, va_list &in_varArgs)=0
 Formats and writes the given log message.
void LogLineVarArgs (LogLevel in_logLevel, 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

Base class for basic logging functionality.

It can be derived to specialize the logging.


Constructor & Destructor Documentation

virtual ~DSILogger (  )  [virtual]

Destructor.

DSILogger (  )  [protected]

Default Constructor.

DSILogger ( LogLevel  in_logLevel,
const simba_string &  in_namespace 
) [protected]

Constructor.

Parameters:
in_logLevel The log level.
in_namespace The log namespace.
DSILogger ( LogLevel  in_logLevel,
const simba_string &  in_namespace,
const simba_string &  in_locale 
) [protected]

Constructor.

Parameters:
in_logLevel The log level.
in_namespace The log namespace.
in_locale The log locale.

Member Function Documentation

static const simba_char* ConvertLogLevelToCString ( LogLevel  in_logLevel  )  [static]

Converts a log level to a c-string.

The output values are:

  • OFF
  • FATAL
  • ERROR
  • WARN
  • INFO
  • DEBUG
  • TRACE
  • UNKWN

Note that the values will be padded with spaces to be 5 characters.

Parameters:
in_level The enum for the LogLevel to get the string representation for.
Returns:
The string representation of the LogLevel. (NOT OWN)
static simba_string ConvertLogLevelToString ( LogLevel  in_logLevel  )  [static]

Converts a log level to a simba_string.

The output values are:

  • OFF
  • FATAL
  • ERROR
  • WARN
  • INFO
  • DEBUG
  • TRACE
  • UNKWN

Note that the values will be padded with spaces to be 5 characters.

Parameters:
in_level The enum for the LogLevel to get the string representation for.
Returns:
The string representation of the LogLevel.
static LogLevel ConvertStringToLogLevel ( const simba_wstring in_wstring  )  [static]

Converts a string to a log level.

Possible input values are:

  • 0 or Off
  • 1 or Fatal
  • 2 or Error
  • 3 or Warning
  • 4 or Info
  • 5 or Debug
  • 6 or Trace

Note that these values are case insensitive.

Parameters:
in_wstring String representation of a LogLevel.
Returns:
The LogLevel value. (Throws an exception if the value is invalid)
static LogLevel ConvertStringToLogLevel ( const simba_string &  in_string  )  [static]

Converts a string to a log level.

Possible input values are:

  • 0 or Off
  • 1 or Fatal
  • 2 or Error
  • 3 or Warning
  • 4 or Info
  • 5 or Debug
  • 6 or Trace

Note that these values are case insensitive.

Parameters:
in_string String representation of a LogLevel.
Returns:
The LogLevel value. (Throws an exception if the value is invalid)
virtual const simba_string& GetLocale (  )  const [virtual]

Gets the locale for this logger.

Returns:
The locale for this logger.

Implements ILogger.

virtual LogLevel GetLogLevel (  )  const [virtual]

Gets the current LogLevel.

Returns:
The current LogLevel.

Implements ILogger.

bool IsInLevel ( LogLevel  in_logLevel  )  [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 *  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 ( LogLevel  in_logLevel,
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, pure virtual]

Formats and writes the given log message.

Parameters:
in_logLevel The log level to include in the log line.
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.

Implemented in DSIFileLogger.

void LogLineVarArgs ( LogLevel  in_logLevel,
const simba_char *  in_namespace,
const simba_char *  in_className,
const simba_char *  in_functionName,
const simba_char *  in_messageFormat,
  ... 
) [protected]

Formats and writes the given log message.

This method forwards its arguments to LogLine.

Parameters:
in_logLevel The log level to include in the log line.
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.
virtual void SetLocale ( const simba_string &  in_locale  )  [virtual]

Sets the Locale for this logger.

Parameters:
in_locale The new locale.
virtual void SetLogLevel ( LogLevel  in_logLevel  )  [virtual]

Sets a new LogLevel for this logger.

Parameters:
in_logLevel The new LogLevel.

Implements ILogger.


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