18#ifndef _LOG4CXX_LOGGER_H
19#define _LOG4CXX_LOGGER_H
61 LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(LoggerPrivate, m_priv)
112#if LOG4CXX_WCHAR_T_API
130#if LOG4CXX_CFSTRING_API
165#if LOG4CXX_WCHAR_T_API
183#if LOG4CXX_CFSTRING_API
218#if LOG4CXX_WCHAR_T_API
236#if LOG4CXX_CFSTRING_API
381#if LOG4CXX_WCHAR_T_API
450#if LOG4CXX_CFSTRING_API
522#if LOG4CXX_WCHAR_T_API
529#if LOG4CXX_CFSTRING_API
563#if LOG4CXX_WCHAR_T_API
570#if LOG4CXX_CFSTRING_API
596 const spi::LoggerFactoryPtr& factory = {});
638#if LOG4CXX_WCHAR_T_API
656#if LOG4CXX_CFSTRING_API
739 return logger && logger->m_threshold <=
Level::DEBUG_INT && logger->isDebugEnabled();
773 return logger && logger->m_threshold <=
Level::INFO_INT && logger->isInfoEnabled();
799 return logger && logger->m_threshold <=
Level::WARN_INT && logger->isWarnEnabled();
825 return logger && logger->m_threshold <=
Level::ERROR_INT && logger->isErrorEnabled();
851 return logger && logger->m_threshold <=
Level::FATAL_INT && logger->isFatalEnabled();
877 return logger && logger->m_threshold <=
Level::TRACE_INT && logger->isTraceEnabled();
900 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
901 const std::vector<LogString>& values)
const;
926 const std::string& val1 = {},
const std::string& val2 = {},
const std::string& val3 = {})
const;
928#if LOG4CXX_WCHAR_T_API
950 const std::wstring& val1 = {},
const std::wstring& val2 = {},
const std::wstring& val3 = {})
const;
952#if LOG4CXX_CFSTRING_API
987#if LOG4CXX_WCHAR_T_API
999#if LOG4CXX_CFSTRING_API
1109#if LOG4CXX_WCHAR_T_API
1127#if LOG4CXX_CFSTRING_API
1162#if LOG4CXX_WCHAR_T_API
1180#if LOG4CXX_CFSTRING_API
1233#if !defined(LOG4CXX_UNLIKELY)
1241 #define LOG4CXX_UNLIKELY(expr) __builtin_expect(expr, 0)
1249 #define LOG4CXX_UNLIKELY(expr) expr
1253#if defined(LOG4CXX_ENABLE_STACKTRACE) && !defined(LOG4CXX_STACKTRACE)
1254 #ifndef __has_include
1255 #include <boost/stacktrace.hpp>
1256 #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + boost::stacktrace::to_string(boost::stacktrace::stacktrace()));
1257 #elif __has_include(<stacktrace>)
1258 #include <stacktrace>
1259 #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + std::stacktrace::to_string(std::stacktrace::stacktrace()));
1260 #elif __has_include(<boost/stacktrace.hpp>)
1261 #include <boost/stacktrace.hpp>
1262 #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + boost::stacktrace::to_string(boost::stacktrace::stacktrace()));
1264 #warning "Stacktrace requested but no implementation found"
1268#if !defined(LOG4CXX_STACKTRACE)
1269#define LOG4CXX_STACKTRACE
1272#ifndef LOG4CXX_FMT_VA_ARG
1273 #define LOG4CXX_FMT_VA_ARG(...) , __VA_ARGS__
1287#define LOG4CXX_LOG(logger, level, message) do { \
1288 if (logger->isEnabledFor(level)) {\
1289 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
1290 logger->addEvent(level, oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1300#define LOG4CXX_LOG_FMT(logger, level, fmt, ...) do { \
1301 if (logger->isEnabledFor(level)) {\
1302 logger->addEvent(level, ::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__) ), LOG4CXX_LOCATION); }} while (0)
1311#define LOG4CXX_LOGLS(logger, level, message) do { \
1312 if (logger->isEnabledFor(level)) {\
1313 ::LOG4CXX_NS::helpers::LogCharMessageBuffer oss_; \
1314 logger->addEvent(level, oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1316#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 10000
1336#define LOG4CXX_DEBUG(logger, message) do { \
1337 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isDebugEnabledFor(logger))) {\
1338 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
1339 logger->addDebugEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1360#define LOG4CXX_DEBUG_FMT(logger, fmt, ...) do { \
1361 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isDebugEnabledFor(logger))) {\
1362 logger->addDebugEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__) ), LOG4CXX_LOCATION); }} while (0)
1364#define LOG4CXX_DEBUG(logger, message)
1365#define LOG4CXX_DEBUG_FMT(logger, fmt, ...)
1368#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 5000
1380#define LOG4CXX_TRACE(logger, message) do { \
1381 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isTraceEnabledFor(logger))) {\
1382 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
1383 logger->addTraceEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1397#define LOG4CXX_TRACE_FMT(logger, fmt, ...) do { \
1398 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isTraceEnabledFor(logger))) {\
1399 logger->addTraceEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
1401#define LOG4CXX_TRACE(logger, message)
1402#define LOG4CXX_TRACE_FMT(logger, fmt, ...)
1405#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 20000
1422#define LOG4CXX_INFO(logger, message) do { \
1423 if (::LOG4CXX_NS::Logger::isInfoEnabledFor(logger)) {\
1424 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
1425 logger->addInfoEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1443#define LOG4CXX_INFO_FMT(logger, fmt, ...) do { \
1444 if (::LOG4CXX_NS::Logger::isInfoEnabledFor(logger)) {\
1445 logger->addInfoEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
1447#define LOG4CXX_INFO(logger, message)
1448#define LOG4CXX_INFO_FMT(logger, fmt, ...)
1451#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 30000
1466#define LOG4CXX_WARN(logger, message) do { \
1467 if (::LOG4CXX_NS::Logger::isWarnEnabledFor(logger)) {\
1468 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
1469 logger->addWarnEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1486#define LOG4CXX_WARN_FMT(logger, fmt, ...) do { \
1487 if (::LOG4CXX_NS::Logger::isWarnEnabledFor(logger)) {\
1488 logger->addWarnEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
1490#define LOG4CXX_WARN(logger, message)
1491#define LOG4CXX_WARN_FMT(logger, fmt, ...)
1494#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 40000
1509#define LOG4CXX_ERROR(logger, message) do { \
1510 if (::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
1511 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
1512 logger->addErrorEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1529#define LOG4CXX_ERROR_FMT(logger, fmt, ...) do { \
1530 if (::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
1531 logger->addErrorEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
1540#define LOG4CXX_ASSERT(logger, condition, message) do { \
1541 if (!(condition) && ::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
1542 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
1543 LOG4CXX_STACKTRACE \
1544 logger->addErrorEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1556#define LOG4CXX_ASSERT_FMT(logger, condition, fmt, ...) do { \
1557 if (!(condition) && ::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
1558 LOG4CXX_STACKTRACE \
1559 logger->addErrorEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
1562#define LOG4CXX_ERROR(logger, message)
1563#define LOG4CXX_ERROR_FMT(logger, fmt, ...)
1564#define LOG4CXX_ASSERT(logger, condition, message)
1565#define LOG4CXX_ASSERT_FMT(logger, condition, fmt, ...)
1568#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 50000
1580#define LOG4CXX_FATAL(logger, message) do { \
1581 if (::LOG4CXX_NS::Logger::isFatalEnabledFor(logger)) {\
1582 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
1583 logger->addFatalEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1597#define LOG4CXX_FATAL_FMT(logger, fmt, ...) do { \
1598 if (::LOG4CXX_NS::Logger::isFatalEnabledFor(logger)) {\
1599 logger->addFatalEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
1601#define LOG4CXX_FATAL(logger, message)
1602#define LOG4CXX_FATAL_FMT(logger, fmt, ...)
1612#define LOG4CXX_L7DLOG(logger, level, key) do { \
1613 if (logger->isEnabledFor(level)) {\
1614 logger->l7dlog(level, key, LOG4CXX_LOCATION); }} while (0)
1624#define LOG4CXX_L7DLOG1(logger, level, key, p1) do { \
1625 if (logger->isEnabledFor(level)) {\
1626 logger->l7dlog(level, key, LOG4CXX_LOCATION, p1); }} while (0)
1637#define LOG4CXX_L7DLOG2(logger, level, key, p1, p2) do { \
1638 if (logger->isEnabledFor(level)) {\
1639 logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2); }} while (0)
1651#define LOG4CXX_L7DLOG3(logger, level, key, p1, p2, p3) do { \
1652 if (logger->isEnabledFor(level)) {\
1653 logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2, p3); }} while (0)
@ DEBUG_INT
Definition level.h:192
@ WARN_INT
Definition level.h:190
@ INFO_INT
Definition level.h:191
@ ERROR_INT
Definition level.h:189
@ FATAL_INT
Definition level.h:188
@ TRACE_INT
Definition level.h:193
This is the central class in the log4cxx package.
Definition log4cxx/logger.h:52
void trace(const CFStringRef &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for TRACE ev...
void setAdditivity(bool additive)
Set the additivity flag for this logger.
void forcedLog(const LevelPtr &level, const std::string &message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing message and location to attached appender(s) without further check...
void addWarnEvent(std::wstring &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new warning level logging event containing message and location to attached appender(s) without...
void addDebugEvent(std::wstring &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new debug level logging event containing message and location to attached appender(s) without f...
void removeAllAppenders() override
Remove all previously added appenders from this logger instance.
bool removeAppender(const AppenderPtr &appender) override
Remove appender from the list of appenders.
friend class Hierarchy
Definition log4cxx/logger.h:1058
static bool isErrorEnabledFor(const LoggerPtr &logger)
Is logger is enabled for ERROR level logging events?
Definition log4cxx/logger.h:823
void addDebugEvent(helpers::AsyncBuffer &&messageAppender, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add to attached appender(s) a new DEBUG level LoggingEvent which was requested at sourceLocation wher...
void warn(const CFStringRef &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for WARN eve...
void setResourceBundle(const helpers::ResourceBundlePtr &bundle)
Set the resource bundle to be used with localized logging methods.
AppenderList getAllAppenders() const override
Get the appenders contained in this logger as an AppenderList.
void fatal(const std::wstring &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
void addEvent(const LevelPtr &level, std::wstring &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing message and location to attached appender(s) without further check...
void forcedLogLS(const LevelPtr &level, const LogString &message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing message and location to attached appender(s) without further check...
void callAppenders(const spi::LoggingEventPtr &event) const
Send event to all appenders attached to this or attached to a parent of this.
void addWarnEvent(std::string &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new warning level logging event containing message and location to attached appender(s) without...
void forcedLog(const LevelPtr &level, const std::wstring &message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing message and location to attached appender(s) without further check...
static LoggerPtr getLogger(const std::wstring &name)
Retrieve a logger by name.
helpers::ResourceBundlePtr getResourceBundle() const
Return the inherited ResourceBundle for this logger.
bool isThresholdEqualTo(const LoggerPtr &other) const
Is m_threshold the same as other.
bool isInfoEnabled() const
Is this logger is enabled for INFO level logging events?
void error(const std::string &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
void addInfoEvent(std::string &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new info level logging event containing message and location to attached appender(s) without fu...
void replaceAppenders(const AppenderList &newList) override
Replace all previously added appenders with newList.
bool isFatalEnabled() const
Is this logger is enabled for FATAL level logging events?
void error(const std::wstring &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
void info(const std::string &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for INFO eve...
void getName(std::wstring &name) const
Put name of this logger into name.
void addTraceEvent(std::wstring &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new trace level logging event containing message and location to attached appender(s) without f...
void l7dlog(const LevelPtr &level, const std::string &key, const spi::LocationInfo &locationInfo=spi::LocationInfo::getLocationUnavailable(), const std::string &val1={}, const std::string &val2={}, const std::string &val3={}) const
Add a new logging event containing locationInfo and the localized message key using parameters val1,...
bool isWarnEnabled() const
Is this logger is enabled for WARN level logging events?
void addEventLS(const LevelPtr &level, LogString &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing message and location to attached appender(s) without further check...
void warn(const std::string &msg, const log4cxx::spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for WARN eve...
bool removeAppender(const LogString &name) override
Remove the name appender from the list of appenders.
void trace(const std::string &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for TRACE ev...
void addAppender(const AppenderPtr &newAppender) override
Add newAppender to the list of appenders of this Logger instance.
void debug(const std::string &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
const LogString & getName() const
Get the logger name.
LogString getResourceBundleString(const LogString &key) const
Returns the string resource corresponding to key in this logger's inherited resource bundle.
bool isEnabledFor(const LevelPtr &level) const
Is this logger is enabled for logging events at level?
void addFatalEvent(std::wstring &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new fatal level logging event containing message and location to attached appender(s) without f...
void info(const std::wstring &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for INFO eve...
void error(const CFStringRef &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
void updateCachedConfiguration()
Recalculate the effective configuration.
static bool isWarnEnabledFor(const LoggerPtr &logger)
Is logger is enabled for WARN level logging events?
Definition log4cxx/logger.h:797
bool isThresholdEqualTo(const LevelPtr &level) const
Is m_threshold the same as level->toInt().
void l7dlog(const LevelPtr &level, const CFStringRef &key, const spi::LocationInfo &locationInfo=spi::LocationInfo::getLocationUnavailable(), const CFStringRef &val1={}, const CFStringRef &val2={}, const CFStringRef &val3={}) const
Add a new logging event containing locationInfo and the localized message key using parameters val1,...
virtual LevelPtr getEffectiveLevel() const
Starting from this logger, search the logger hierarchy for a non-null level and return it.
void fatal(const CFStringRef &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
void log(const LevelPtr &level, const std::string &message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing message and location to the appenders attached to this logger if t...
void addEvent(const LevelPtr &level, std::string &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing message and location to attached appender(s) without further check...
void addFatalEvent(helpers::AsyncBuffer &&messageAppender, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add to attached appender(s) a new FATAL level LoggingEvent which was requested at sourceLocation wher...
void log(const LevelPtr &level, const CFStringRef &message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing message and location to the appenders attached to this logger if t...
void addErrorEvent(std::wstring &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new error level logging event containing message and location to attached appender(s) without f...
void info(const CFStringRef &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for INFO eve...
static bool isDebugEnabledFor(const LoggerPtr &logger)
Is logger is enabled for DEBUG level logging events?
Definition log4cxx/logger.h:737
AppenderPtr getAppender(const LogString &name) const override
Look for the appender named as name.
void setHierarchy(spi::LoggerRepository *repository)
Only the Hierarchy class can set the hierarchy of a logger.
void setParent(const LoggerPtr &parentLogger)
Only the Hierarchy class can set the parent of a logger.
void l7dlog(const LevelPtr &level, const std::wstring &key, const spi::LocationInfo &locationInfo=spi::LocationInfo::getLocationUnavailable(), const std::wstring &val1={}, const std::wstring &val2={}, const std::wstring &val3={}) const
Add a new logging event containing locationInfo and the localized message key using parameters val1,...
static bool isFatalEnabledFor(const LoggerPtr &logger)
Is logger is enabled for FATAL level logging events?
Definition log4cxx/logger.h:849
static LoggerPtr getLogger(const CFStringRef &name)
Retrieve a logger by name.
void addInfoEvent(helpers::AsyncBuffer &&messageAppender, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add to attached appender(s) a new INFO level LoggingEvent which was requested at sourceLocation where...
void debug(const CFStringRef &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
void debug(const std::wstring &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
Logger(const LogString &name)
This constructor initializes a new logger instance and sets its name.
void changeParentTo(const LoggerPtr &otherLogger)
void addFatalEvent(std::string &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new fatal level logging event containing message and location to attached appender(s) without f...
static bool isInfoEnabledFor(const LoggerPtr &logger)
Is logger is enabled for INFO level logging events?
Definition log4cxx/logger.h:771
static LoggerPtr getLogger(const std::string &name)
Retrieve a logger by name in current encoding.
bool isDebugEnabled() const
Is this logger is enabled for DEBUG level logging events?
void removeHierarchy()
Only the Hierarchy class can remove the hierarchy of a logger.
void getName(std::string &name) const
Put name of this logger into name in current encoding.
void addErrorEvent(helpers::AsyncBuffer &&messageAppender, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add to attached appender(s) a new ERROR level LoggingEvent which was requested at sourceLocation wher...
bool getAdditivity() const
Get the additivity flag for this logger.
void getName(CFStringRef &name) const
Put name of this logger into name.
static LoggerPtr getRootLogger()
Retrieve the root logger.
void fatal(const std::string &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
void addTraceEvent(helpers::AsyncBuffer &&messageAppender, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add to attached appender(s) a new TRACE level LoggingEvent which was requested at sourceLocation wher...
LoggerPtr getParent() const
The parent of this logger.
void l7dlog(const LevelPtr &level, const LogString &key, const log4cxx::spi::LocationInfo &locationInfo, const std::vector< LogString > &values) const
bool isAttached(const AppenderPtr &appender) const override
Is appender attached to this logger?
void closeNestedAppenders()
Close all attached appenders implementing the AppenderAttachable interface.
void addErrorEvent(std::string &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new error level logging event containing message and location to attached appender(s) without f...
void reconfigure(const AppenderList &newList, bool newAdditivity)
Replace all current appenders with newList and set the additivity flag to newAdditivity.
void logLS(const LevelPtr &level, const LogString &message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing message and location to the appenders attached to this logger if t...
void log(const LevelPtr &level, const std::wstring &message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing message and location to the appenders attached to this logger if t...
void addWarnEvent(helpers::AsyncBuffer &&messageAppender, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add to attached appender(s) a new WARN level LoggingEvent which was requested at sourceLocation where...
LevelPtr getLevel() const
The assigned Level, if any, for this logger.
void forcedLog(const LevelPtr &level, const CFStringRef &message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing message and location to attached appender(s) without further check...
bool replaceAppender(const AppenderPtr &oldAppender, const AppenderPtr &newAppender) override
Replace oldAppender with newAppender.
static LoggerPtr getLoggerLS(const LogString &name, const spi::LoggerFactoryPtr &factory={})
Like getLogger except that the type of logger instantiated depends on the type returned by the Logger...
void addInfoEvent(std::wstring &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new info level logging event containing message and location to attached appender(s) without fu...
void addDebugEvent(std::string &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new debug level logging event containing message and location to attached appender(s) without f...
bool isThresholdValid() const
Is m_threshold the same as getEffectiveLevel()->toInt().
static bool isTraceEnabledFor(const LoggerPtr &logger)
Is logger is enabled for TRACE level logging events?
Definition log4cxx/logger.h:875
static spi::LoggerRepositoryPtr getLoggerRepository()
The object that holds all Logger instances.
void addEvent(const LevelPtr &level, helpers::AsyncBuffer &&messageAppender, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add to attached appender(s) a new level LoggingEvent which was requested at sourceLocation where the ...
bool isErrorEnabled() const
Is this logger is enabled for ERROR level logging events?
void trace(const std::wstring &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for TRACE ev...
void warn(const std::wstring &msg, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for WARN eve...
virtual void setLevel(const LevelPtr &level)
Set the level of this logger.
void addTraceEvent(std::string &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new trace level logging event containing message and location to attached appender(s) without f...
bool isTraceEnabled() const
Is this logger is enabled for TRACE level logging events?
This class is used by the LOG4CXX_INFO_ASYNC and similar macros to support insertion operators.
Definition asyncbuffer.h:56
This Interface is for attaching Appenders to objects.
Definition appenderattachable.h:37
This class represents the location of a logging statement.
Definition locationinfo.h:40
static const LocationInfo & getLocationUnavailable()
Implement this interface to create new instances of Logger or a sub-class of Logger.
Definition loggerfactory.h:33
A LoggerRepository is used to create and retrieve Loggers.
Definition loggerrepository.h:43
The data recorded for each logging request.
Definition loggingevent.h:47
const struct __CFString * CFStringRef
Definition logstring.h:30
std::shared_ptr< LoggerRepository > LoggerRepositoryPtr
Definition repositoryselector.h:28
std::shared_ptr< LoggingEvent > LoggingEventPtr
Definition appender.h:32
LOG4CXX_PTR_DEF(LoggingEvent)
LOG4CXX_LIST_DEF(AppenderList, AppenderPtr)
std::basic_string< logchar > LogString
Definition logstring.h:51
std::shared_ptr< Appender > AppenderPtr
Definition basicconfigurator.h:29
std::shared_ptr< Level > LevelPtr
Definition optionconverter.h:28
LOG4CXX_PTR_DEF(Appender)
std::shared_ptr< Logger > LoggerPtr
Definition provisionnode.h:28
#define LOG4CXX_CAST_ENTRY(Interface)
Definition object.h:153
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)
Definition object.h:37
#define END_LOG4CXX_CAST_MAP()
Definition object.h:147
#define BEGIN_LOG4CXX_CAST_MAP()
Definition object.h:141