38 #include "blocxx/BLOCXX_config.h" 67 : m_defaultComponent(defaultComponent)
68 , m_appender(appender ? appender :
LogAppender::getCurrentLogAppender())
69 , m_logLevel(m_appender->getLogLevel())
String getDefaultComponent() const
Gets the default component.
static ELogLevel stringToLogLevel(const String &logLevel)
Convert a log level string to an enum value.
void logMessage(const LogMessage &message) const
Log a message using the specified component and category.
Logger(const String &defaultComponent=STR_DEFAULT_COMPONENT, const LogAppenderRef &appender=LogAppenderRef())
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.
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 setDefaultComponent(const String &component)
Sets the default component.
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 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_NONE_CATEGORY
String m_defaultComponent
#define BLOCXX_ASSERT(CON)
BLOCXX_ASSERT works similar to the assert() macro, but instead of calling abort(), it throws an AssertionException.
static const GlobalString STR_ALL_CATEGORY
static const GlobalString STR_DEBUG2_CATEGORY
void swap(Array< T > &x, Array< T > &y)
This String class is an abstract data type that represents as NULL terminated string of characters...
static const GlobalString STR_INFO_CATEGORY
static const GlobalString STR_DEBUG3_CATEGORY
#define BLOCXX_DEFINE_EXCEPTION_WITH_ID(NAME)
Define a new exception class named <NAME>Exception that derives from Exception.
static const GlobalString STR_FATAL_CATEGORY
bool equalsIgnoreCase(const String &arg) const
Determine if another String object is equal to this String object, ignoring case in the comparision...
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 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...
bool componentAndCategoryAreEnabled(const String &component, const String &category) const
Determine if the component and category are both enabled.
bool levelIsEnabled(const ELogLevel level) const
Check if the logger is enabled for given level.
LogAppenderRef m_appender
void swap(String &x)
Swap this instance with another.
bool componentAndCategoryAreEnabled(const String &component, const String &category) const
void setLogLevel(ELogLevel logLevel)
Set the log level.
IntrusiveReference< Logger > LoggerRef
bool categoryIsEnabled(const String &category) const
Logger & operator=(const Logger &)
#define BLOCXX_GLOBAL_STRING_INIT(str)
bool categoryIsEnabled(const String &category) const
Determine if the log category is enabled.
static String logLevelToString(ELogLevel logLevel)
Convert a log level enum to a string.
static const GlobalString STR_WARNING_CATEGORY
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_DEBUG_CATEGORY
This class can be used to store a global variable that is lazily initialized in a thread safe manner...
static const GlobalString STR_ERROR_CATEGORY
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...
virtual LoggerRef clone() const BLOCXX_DEPRECATED
void swap(IntrusiveReference &rhs)
static const GlobalString STR_DEFAULT_COMPONENT
void processLogMessage(const LogMessage &message) const