DSIFileLogger Class Reference

Logger class that logs to a file. More...

Inherits Simba::DSI::DSILogger.

List of all members.

Public Member Functions

 DSIFileLogger (const simba_wstring &in_filePath, LogLevel in_logLevel, const simba_string &in_namespace, simba_size_t in_maxFileSize, simba_uint32 in_maxFileCount)
 Constructor.
 DSIFileLogger (const simba_wstring &in_filePath, LogLevel in_logLevel, const simba_string &in_namespace)
 Constructor.
 DSIFileLogger (const simba_wstring &in_fileName)
 Constructor.
void SetFilename (const simba_wstring &in_filePath)
 Sets the absolute path of the file to log to.
virtual ~DSIFileLogger ()
 Destructor.

Protected Member Functions

virtual void CreateFormatString (LogLevel in_level, const simba_char *in_namespace, const simba_char *in_className, const simba_char *in_functionName, const simba_char *in_messageFormat, simba_string &out_logLine)
 Creates the format string for the log message by prepending the message header to the given message format string.
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)
 Formats and writes the given log message.
void WriteFormattedLine (const simba_char *in_messageFormat, va_list &in_args)
 Writes a formatted line to the log.

Detailed Description

Logger class that logs to a file.


Constructor & Destructor Documentation

DSIFileLogger ( const simba_wstring in_fileName  ) 

Constructor.

Creates a DSIFileLogger that uses settings provided by the registry or INI file.

Parameters:
in_fileName The filename of the file to log to. This should not be an absolute path, as it may be configured through external settings.
DSIFileLogger ( const simba_wstring in_filePath,
LogLevel  in_logLevel,
const simba_string &  in_namespace 
)

Constructor.

Creates a DSIFileLogger that overrides settings provided by the registry or INI file for log path, log level, and namespace, and and uses the registry or INI settings for log rotation.

Parameters:
in_filePath The absolute path to the file to log to.
in_logLevel The log level.
in_namespace The log namespace.
DSIFileLogger ( const simba_wstring in_filePath,
LogLevel  in_logLevel,
const simba_string &  in_namespace,
simba_size_t  in_maxFileSize,
simba_uint32  in_maxFileCount 
)

Constructor.

Creates a DSIFileLogger that overrides settings provided by the registry or INI file.

Parameters:
in_filePath The absolute path to the file to log to.
in_logLevel The log level.
in_namespace The log namespace.
in_maxFileSize The maximum size of a log file. 0 means no maximum.
in_maxFileCount The maximum number of files to log to, >= 1. The value 1 disables log rotation.
Exceptions:
InvalidArgumentException If in_maxFileCount < 1.
virtual ~DSIFileLogger (  )  [virtual]

Destructor.


Member Function Documentation

virtual void CreateFormatString ( LogLevel  in_level,
const simba_char *  in_namespace,
const simba_char *  in_className,
const simba_char *  in_functionName,
const simba_char *  in_messageFormat,
simba_string &  out_logLine 
) [protected, virtual]

Creates the format string for the log message by prepending the message header to the given message format string.

Parameters:
in_logLevel The log level to include in the log message.
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 to log. (NOT OWN)
out_logLine The format string for the log message.
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, virtual]

Formats and writes the given log message.

This method does not throw an exception.

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.

Implements DSILogger.

void SetFilename ( const simba_wstring in_filePath  ) 

Sets the absolute path of the file to log to.

Parameters:
in_filePath The absolute path to the file to log to.
void WriteFormattedLine ( const simba_char *  in_messageFormat,
va_list &  in_args 
) [protected]

Writes a formatted line to the log.

Parameters:
in_messageFormat The format string.
in_args The format arguments.

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