#include <ScopeLogger.h>
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. |
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.
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.
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.
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.
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().