Go to the documentation of this file.
38 #include "blocxx/BLOCXX_config.h"
67 : m_defaultComponent(defaultComponent)
68 , m_appender(appender ? appender :
LogAppender::getCurrentLogAppender())
69 , m_logLevel(m_appender->getLogLevel())
76 : m_defaultComponent(defaultComponent)
78 , m_logLevel(logLevel)
86 , m_defaultComponent(x.m_defaultComponent)
87 , m_appender(x.m_appender)
88 , m_logLevel(x.m_logLevel)
126 Logger::logFatalError(
const String& message,
const char* filename,
int fileline,
const char* methodname)
const
void swap(IntrusiveReference &rhs)
LogAppenderRef m_appender
String m_defaultComponent
static String logLevelToString(ELogLevel logLevel)
Convert a log level enum to a string.
ELogLevel getLogLevel() const
void logDebug(const String &message, const char *filename=0, int fileline=-1, const char *methodname=0) const
If getLogLevel() >= E_DEBUG_LEVEL, Log debug info.
static const GlobalString STR_WARNING_CATEGORY
bool levelIsEnabled(const ELogLevel level) const
Check if the logger is enabled for given level.
This String class is an abstract data type that represents as NULL terminated string of characters.
void swap(String &x)
Swap this instance with another.
Logger(const String &defaultComponent=STR_DEFAULT_COMPONENT, const LogAppenderRef &appender=LogAppenderRef())
String getDefaultComponent() const
Gets the default component.
static const GlobalString STR_INFO_CATEGORY
void swap(Array< T > &x, Array< T > &y)
static ELogLevel stringToLogLevel(const String &logLevel)
Convert a log level string to an enum value.
void setLogLevel(ELogLevel logLevel)
Set the log level.
void logError(const String &message, const char *filename=0, int fileline=-1, const char *methodname=0) const
If getLogLevel() >= E_ERROR_LEVEL, Log message with an error category and the default component.
void processLogMessage(const LogMessage &message) const
void logWarning(const String &message, const char *filename=0, int fileline=-1, const char *methodname=0) const
If getLogLevel() >= E_WARNING_LEVEL, Log info.
void logFatalError(const String &message, const char *filename=0, int fileline=-1, const char *methodname=0) const
Log message with a fatal error category and the default component.
static const GlobalString STR_DEBUG3_CATEGORY
class BLOCXX_COMMON_API Logger
LazyGlobal< String, char const *const > GlobalString
static const GlobalString STR_FATAL_CATEGORY
IntrusiveReference< Logger > LoggerRef
static const GlobalString STR_ALL_CATEGORY
class BLOCXX_COMMON_API LogAppender
static const GlobalString STR_DEFAULT_COMPONENT
void logDebug2(const String &message, const char *filename=0, int fileline=-1, const char *methodname=0) const
If getLogLevel() >= E_DEBUG2_LEVEL, Log debug info.
#define BLOCXX_GLOBAL_STRING_INIT(str)
void logMessage(const LogMessage &message) const
Log a message using the specified component and category.
bool componentAndCategoryAreEnabled(const String &component, const String &category) const
static const GlobalString STR_ERROR_CATEGORY
bool categoryIsEnabled(const String &category) const
Determine if the log category is enabled.
bool categoryIsEnabled(const String &category) const
virtual LoggerRef clone() const BLOCXX_DEPRECATED
static const GlobalString STR_DEBUG_CATEGORY
#define BLOCXX_DEFINE_EXCEPTION_WITH_ID(NAME)
Define a new exception class named <NAME>Exception that derives from Exception.
void logInfo(const String &message, const char *filename=0, int fileline=-1, const char *methodname=0) const
If getLogLevel() >= E_INFO_LEVEL, Log info.
void logDebug3(const String &message, const char *filename=0, int fileline=-1, const char *methodname=0) const
If getLogLevel() >= E_DEBUG3_LEVEL, Log debug info.
void logMessage(const String &component, const String &category, const String &message) const
Log a message using the specified component and category The current log level is ignored.
void setDefaultComponent(const String &component)
Sets the default component.
bool componentAndCategoryAreEnabled(const String &component, const String &category) const
Determine if the component and category are both enabled.
IntrusiveReference< LogAppender > LogAppenderRef
static const GlobalString STR_DEBUG2_CATEGORY
#define BLOCXX_ASSERT(CON)
BLOCXX_ASSERT works similar to the assert() macro, but instead of calling abort(),...
bool equalsIgnoreCase(const String &arg) const
Determine if another String object is equal to this String object, ignoring case in the comparision.
Logger & operator=(const Logger &)
static const GlobalString STR_NONE_CATEGORY