ScopeLogger Class Reference

Helper class for the user of the logging system. Allows to define the hierarchy of the project. More...

#include <ScopeLogger.h>

List of all members.

Public Member Functions

 ScopeLogger (const std::tstring &name)
 Constructor.
void Log (LogLevel logLevel, const CompositeLoggable &message, std::tstring functionName, int lineNumber, std::tstring fileName)
 Passes the log message to the logging system via Logger::Log() method.
bool IsFiltered (LogLevel logLevel)
 Helper method to determine whether message with the particular logLevel should be filtered or not.

Private Attributes

std::tstring m_name
 Name of this ScopeLogger.
LogLevel m_maximumLogLevel
 Maximum LogLevel at which log messages should be passed to static Logger object.


Detailed Description

Helper class for the user of the logging system. Allows to define the hierarchy of the project.

This hierarchy is later used to filter and decorate the logging output. User should make one static instance of this object available in each class or function he wants to use logging in. This should be done using DEFINE_LOGGER() macro.

Definition at line 96 of file ScopeLogger.h.


Constructor & Destructor Documentation

ScopeLogger ( const std::tstring &  name  )  [inline]

Constructor.

Sets the m_name attribute and calls Logger::GetMaximumLogLevel(m_name) to determine m_maximumLogLevel for this ScopeLogger.

Parameters:
name String representing the place of the enclosing class or function in the project hierarchy. It should be in the following form: "SystemName.SubSystemName.SubSubSystemName.(...).ElementName". User can assign arbitrary meanings to the names on each level, as they are used only as identificators for filtering and decorating purporses.

Definition at line 131 of file ScopeLogger.h.


Member Function Documentation

void Log ( LogLevel  logLevel,
const CompositeLoggable message,
std::tstring  functionName,
int  lineNumber,
std::tstring  fileName 
) [inline]

Passes the log message to the logging system via Logger::Log() method.

This method shouldn't be used directly by the user, please use LOG() or LOGF() macros instead.

Definition at line 135 of file ScopeLogger.h.

References Logger::GetLogger(), Logger::Log(), and ScopeLogger::m_name.


Member Data Documentation

LogLevel m_maximumLogLevel [private]

Maximum LogLevel at which log messages should be passed to static Logger object.

Each message with LogLevel above this value, when passed to this ScopeLogger via LOG() or LOGF() macro, will be filtered (ignored).

Definition at line 107 of file ScopeLogger.h.

Referenced by ScopeLogger::IsFiltered().


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

Generated on Thu Sep 17 15:05:17 2009 for Logging by  doxygen 1.5.8