18#ifndef _LOG4CXX_LOGGER_H
19#define _LOG4CXX_LOGGER_H
34class LoggerRepository;
60 LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(LoggerPrivate, m_priv)
110 void debug(
const std::string& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
125 void debug(
const std::string& msg)
const;
126#if LOG4CXX_WCHAR_T_API
142 void debug(
const std::wstring& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
157 void debug(
const std::wstring& msg)
const;
159#if LOG4CXX_CFSTRING_API
208 void error(
const std::string& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
223 void error(
const std::string& msg)
const;
224#if LOG4CXX_WCHAR_T_API
239 void error(
const std::wstring& msg)
const;
255 void error(
const std::wstring& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
257#if LOG4CXX_CFSTRING_API
306 void fatal(
const std::string& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
321 void fatal(
const std::string& msg)
const;
322#if LOG4CXX_WCHAR_T_API
338 void fatal(
const std::wstring& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
353 void fatal(
const std::wstring& msg)
const;
355#if LOG4CXX_CFSTRING_API
513 const LOG4CXX_NS::spi::LocationInfo& location)
const;
522#if LOG4CXX_WCHAR_T_API
589 const LOG4CXX_NS::spi::LocationInfo& location)
const;
598#if LOG4CXX_CFSTRING_API
607 const LOG4CXX_NS::spi::LocationInfo& location)
const;
634 const LOG4CXX_NS::spi::LocationInfo& location)
const;
677#if LOG4CXX_WCHAR_T_API
684#if LOG4CXX_CFSTRING_API
723#if LOG4CXX_WCHAR_T_API
735#if LOG4CXX_CFSTRING_API
767 const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
782 const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
783#if LOG4CXX_WCHAR_T_API
798 const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
800#if LOG4CXX_CFSTRING_API
815 const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
857 void info(
const std::string& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
872 void info(
const std::string& msg)
const;
873#if LOG4CXX_WCHAR_T_API
889 void info(
const std::wstring& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
904 void info(
const std::wstring& msg)
const;
906#if LOG4CXX_CFSTRING_API
922 void info(
const CFStringRef& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
1004 return logger && logger->m_threshold <=
Level::DEBUG_INT && logger->isDebugEnabled();
1038 return logger && logger->m_threshold <=
Level::INFO_INT && logger->isInfoEnabled();
1064 return logger && logger->m_threshold <=
Level::WARN_INT && logger->isWarnEnabled();
1090 return logger && logger->m_threshold <=
Level::ERROR_INT && logger->isErrorEnabled();
1116 return logger && logger->m_threshold <=
Level::FATAL_INT && logger->isFatalEnabled();
1142 return logger && logger->m_threshold <=
Level::TRACE_INT && logger->isTraceEnabled();
1164 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1165 const std::vector<LogString>& values)
const;
1182 const LOG4CXX_NS::spi::LocationInfo& locationInfo)
const;
1201 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1202 const std::string& val)
const;
1222 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1223 const std::string& val1,
const std::string& val2)
const;
1244 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1245 const std::string& val1,
const std::string& val2,
const std::string& val3)
const;
1247#if LOG4CXX_WCHAR_T_API
1264 const LOG4CXX_NS::spi::LocationInfo& locationInfo)
const;
1283 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1284 const std::wstring& val)
const;
1304 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1305 const std::wstring& val1,
const std::wstring& val2)
const;
1326 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1327 const std::wstring& val1,
const std::wstring& val2,
const std::wstring& val3)
const;
1329#if LOG4CXX_CFSTRING_API
1346 const LOG4CXX_NS::spi::LocationInfo& locationInfo)
const;
1365 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1386 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1408 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1422 const LOG4CXX_NS::spi::LocationInfo& location)
const;
1432#if LOG4CXX_WCHAR_T_API
1442 const LOG4CXX_NS::spi::LocationInfo& location)
const;
1453#if LOG4CXX_CFSTRING_API
1463 const LOG4CXX_NS::spi::LocationInfo& location)
const;
1483 const LOG4CXX_NS::spi::LocationInfo& location)
const;
1573#if LOG4CXX_WCHAR_T_API
1589 void warn(
const std::wstring& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
1604 void warn(
const std::wstring& msg)
const;
1606#if LOG4CXX_CFSTRING_API
1654 void warn(
const std::string& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
1669 void warn(
const std::string& msg)
const;
1671#if LOG4CXX_WCHAR_T_API
1687 void trace(
const std::wstring& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
1702 void trace(
const std::wstring& msg)
const;
1704#if LOG4CXX_CFSTRING_API
1752 void trace(
const std::string& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
1767 void trace(
const std::string& msg)
const;
1787#if !defined(LOG4CXX_UNLIKELY)
1795 #define LOG4CXX_UNLIKELY(expr) __builtin_expect(expr, 0)
1803 #define LOG4CXX_UNLIKELY(expr) expr
1807#if defined(LOG4CXX_ENABLE_STACKTRACE) && !defined(LOG4CXX_STACKTRACE)
1808 #ifndef __has_include
1809 #include <boost/stacktrace.hpp>
1810 #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + boost::stacktrace::to_string(boost::stacktrace::stacktrace()));
1811 #elif __has_include(<stacktrace>)
1812 #include <stacktrace>
1813 #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + std::stacktrace::to_string(std::stacktrace::stacktrace()));
1814 #elif __has_include(<boost/stacktrace.hpp>)
1815 #include <boost/stacktrace.hpp>
1816 #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + boost::stacktrace::to_string(boost::stacktrace::stacktrace()));
1818 #warning "Stacktrace requested but no implementation found"
1822#if !defined(LOG4CXX_STACKTRACE)
1823#define LOG4CXX_STACKTRACE
1826#ifndef LOG4CXX_FMT_VA_ARG
1827 #define LOG4CXX_FMT_VA_ARG(...) , __VA_ARGS__
1841#define LOG4CXX_LOG(logger, level, message) do { \
1842 if (logger->isEnabledFor(level)) {\
1843 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
1844 logger->addEvent(level, oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1854#define LOG4CXX_LOG_FMT(logger, level, fmt, ...) do { \
1855 if (logger->isEnabledFor(level)) {\
1856 logger->addEvent(level, ::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__) ), LOG4CXX_LOCATION); }} while (0)
1865#define LOG4CXX_LOGLS(logger, level, message) do { \
1866 if (logger->isEnabledFor(level)) {\
1867 ::LOG4CXX_NS::helpers::LogCharMessageBuffer oss_; \
1868 logger->addEvent(level, oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1870#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 10000
1890#define LOG4CXX_DEBUG(logger, message) do { \
1891 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isDebugEnabledFor(logger))) {\
1892 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
1893 logger->addDebugEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1914#define LOG4CXX_DEBUG_FMT(logger, fmt, ...) do { \
1915 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isDebugEnabledFor(logger))) {\
1916 logger->addDebugEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__) ), LOG4CXX_LOCATION); }} while (0)
1918#define LOG4CXX_DEBUG(logger, message)
1919#define LOG4CXX_DEBUG_FMT(logger, fmt, ...)
1922#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 5000
1934#define LOG4CXX_TRACE(logger, message) do { \
1935 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isTraceEnabledFor(logger))) {\
1936 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
1937 logger->addTraceEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1951#define LOG4CXX_TRACE_FMT(logger, fmt, ...) do { \
1952 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isTraceEnabledFor(logger))) {\
1953 logger->addTraceEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
1955#define LOG4CXX_TRACE(logger, message)
1956#define LOG4CXX_TRACE_FMT(logger, fmt, ...)
1959#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 20000
1976#define LOG4CXX_INFO(logger, message) do { \
1977 if (::LOG4CXX_NS::Logger::isInfoEnabledFor(logger)) {\
1978 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
1979 logger->addInfoEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1997#define LOG4CXX_INFO_FMT(logger, fmt, ...) do { \
1998 if (::LOG4CXX_NS::Logger::isInfoEnabledFor(logger)) {\
1999 logger->addInfoEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2001#define LOG4CXX_INFO(logger, message)
2002#define LOG4CXX_INFO_FMT(logger, fmt, ...)
2005#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 30000
2020#define LOG4CXX_WARN(logger, message) do { \
2021 if (::LOG4CXX_NS::Logger::isWarnEnabledFor(logger)) {\
2022 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2023 logger->addWarnEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2040#define LOG4CXX_WARN_FMT(logger, fmt, ...) do { \
2041 if (::LOG4CXX_NS::Logger::isWarnEnabledFor(logger)) {\
2042 logger->addWarnEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2044#define LOG4CXX_WARN(logger, message)
2045#define LOG4CXX_WARN_FMT(logger, fmt, ...)
2048#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 40000
2063#define LOG4CXX_ERROR(logger, message) do { \
2064 if (::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2065 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2066 logger->addErrorEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2083#define LOG4CXX_ERROR_FMT(logger, fmt, ...) do { \
2084 if (::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2085 logger->addErrorEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2094#define LOG4CXX_ASSERT(logger, condition, message) do { \
2095 if (!(condition) && ::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2096 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2097 LOG4CXX_STACKTRACE \
2098 logger->addErrorEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2110#define LOG4CXX_ASSERT_FMT(logger, condition, fmt, ...) do { \
2111 if (!(condition) && ::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2112 LOG4CXX_STACKTRACE \
2113 logger->addErrorEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2116#define LOG4CXX_ERROR(logger, message)
2117#define LOG4CXX_ERROR_FMT(logger, fmt, ...)
2118#define LOG4CXX_ASSERT(logger, condition, message)
2119#define LOG4CXX_ASSERT_FMT(logger, condition, fmt, ...)
2122#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 50000
2134#define LOG4CXX_FATAL(logger, message) do { \
2135 if (::LOG4CXX_NS::Logger::isFatalEnabledFor(logger)) {\
2136 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2137 logger->addFatalEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2151#define LOG4CXX_FATAL_FMT(logger, fmt, ...) do { \
2152 if (::LOG4CXX_NS::Logger::isFatalEnabledFor(logger)) {\
2153 logger->addFatalEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2155#define LOG4CXX_FATAL(logger, message)
2156#define LOG4CXX_FATAL_FMT(logger, fmt, ...)
2166#define LOG4CXX_L7DLOG(logger, level, key) do { \
2167 if (logger->isEnabledFor(level)) {\
2168 logger->l7dlog(level, key, LOG4CXX_LOCATION); }} while (0)
2178#define LOG4CXX_L7DLOG1(logger, level, key, p1) do { \
2179 if (logger->isEnabledFor(level)) {\
2180 logger->l7dlog(level, key, LOG4CXX_LOCATION, p1); }} while (0)
2191#define LOG4CXX_L7DLOG2(logger, level, key, p1, p2) do { \
2192 if (logger->isEnabledFor(level)) {\
2193 logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2); }} while (0)
2205#define LOG4CXX_L7DLOG3(logger, level, key, p1, p2, p3) do { \
2206 if (logger->isEnabledFor(level)) {\
2207 logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2, p3); }} while (0)
@ DEBUG_INT
Definition level.h:193
@ WARN_INT
Definition level.h:191
@ INFO_INT
Definition level.h:192
@ ERROR_INT
Definition level.h:190
@ FATAL_INT
Definition level.h:189
@ TRACE_INT
Definition level.h:194
This is the central class in the log4cxx package.
Definition log4cxx/logger.h:51
void log(const LevelPtr &level, const std::wstring &message) const
Add a new logging event containing message to the appenders attached to this logger if this logger is...
void info(const std::string &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for INFO eve...
void setAdditivity(bool additive)
Set the additivity flag for this logger.
virtual const LevelPtr & getEffectiveLevel() const
Starting from this logger, search the logger hierarchy for a non-null level and return it.
void info(const std::wstring &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for INFO eve...
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.
static LoggerPtr getLogger(const std::string &name, const log4cxx::spi::LoggerFactoryPtr &factory)
Like getLogger except that the type of logger instantiated depends on the type returned by the Logger...
void warn(const std::wstring &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for WARN eve...
void l7dlog(const LevelPtr &level, const std::string &key, const log4cxx::spi::LocationInfo &locationInfo, 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,...
friend class Hierarchy
Definition log4cxx/logger.h:1522
void setParent(LoggerPtr parentLogger)
Only the Hierarchy class can set the parent of a logger.
static bool isErrorEnabledFor(const LoggerPtr &logger)
Is logger is enabled for ERROR level logging events?
Definition log4cxx/logger.h:1088
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...
static LoggerPtr getLoggerLS(const LogString &name, const log4cxx::spi::LoggerFactoryPtr &factory)
Like getLogger except that the type of logger instantiated depends on the type returned by the Logger...
void debug(const CFStringRef &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for DEBUG ev...
static LoggerPtr getLoggerLS(const LogString &name)
Retrieve a logger by name in Unicode.
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 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 warn(const std::string &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for WARN eve...
void error(const std::wstring &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for ERROR ev...
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 trace(const std::string &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for TRACE ev...
static LoggerPtr getLogger(const std::wstring &name)
Retrieve a logger by name.
helpers::ResourceBundlePtr getResourceBundle() const
Return the inherited ResourceBundle for this logger.
void fatal(const std::wstring &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
bool isThresholdEqualTo(const LoggerPtr &other) const
Is m_threshold the same as other.
void logLS(const LevelPtr &level, const LogString &message, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing message and location to the appenders attached to this logger if t...
static LoggerPtr getLogger(const char *const name)
Retrieve a logger by name in current encoding.
bool isInfoEnabled() const
Is this logger is enabled for INFO level logging events?
void trace(const std::string &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for TRACE ev...
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...
bool isAttached(const AppenderPtr appender) const override
Is appender attached to this logger?
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 warn(const CFStringRef &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for WARN eve...
void log(const LevelPtr &level, const CFStringRef &message) const
Add a new logging event containing message to the appenders attached to this logger if this logger is...
virtual void setLevel(const LevelPtr level)
Set the level of this logger.
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...
bool isWarnEnabled() const
Is this logger is enabled for WARN level logging events?
void l7dlog(const LevelPtr &level, const std::wstring &key, const log4cxx::spi::LocationInfo &locationInfo, const std::wstring &val) const
Add a new logging event containing locationInfo and the localized message key using parameter val to ...
void removeAppender(const LogString &name) override
Remove the appender with the name passed as parameter form the list of appenders.
void fatal(const CFStringRef &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for FATAL ev...
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 log(const LevelPtr &level, const std::string &message) const
Add a new logging event containing message to the appenders attached to this logger if this logger is...
void l7dlog(const LevelPtr &level, const CFStringRef &key, const log4cxx::spi::LocationInfo &locationInfo) const
Add a new logging event containing locationInfo and the localized message key to attached appender(s)...
void trace(const std::wstring &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for TRACE ev...
void error(const std::string &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for ERROR ev...
void l7dlog(const LevelPtr &level, const CFStringRef &key, const log4cxx::spi::LocationInfo &locationInfo, const CFStringRef &val1, const CFStringRef &val2) const
Add a new logging event containing locationInfo and the localized message key using parameters val1 a...
void fatal(const std::wstring &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for FATAL ev...
static LoggerPtr getLogger(const CFStringRef &name, const log4cxx::spi::LoggerFactoryPtr &factory)
Like getLogger except that the type of logger instantiated depends on the type returned by the Logger...
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?
static LoggerPtr getLogger(const wchar_t *const name)
Retrieve a logger by name.
void debug(const std::string &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
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 debug(const CFStringRef &msg, const log4cxx::spi::LocationInfo &location) 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
Add a new logging event containing msg to attached appender(s) if this logger is enabled for INFO eve...
static bool isWarnEnabledFor(const LoggerPtr &logger)
Is logger is enabled for WARN level logging events?
Definition log4cxx/logger.h:1062
void error(const CFStringRef &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for ERROR ev...
bool isThresholdEqualTo(const LevelPtr &level) const
Is m_threshold the same as level->toInt().
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 error(const std::wstring &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
void warn(const std::string &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for WARN eve...
void l7dlog(const LevelPtr &level, const std::string &key, const log4cxx::spi::LocationInfo &locationInfo, const std::string &val) const
Add a new logging event containing locationInfo and the localized message key using parameter val to ...
void warn(const CFStringRef &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for WARN eve...
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 forcedLog(const LevelPtr &level, const CFStringRef &message, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing message and location to attached appender(s) without further check...
void forcedLog(const LevelPtr &level, const CFStringRef &message) const
Add a new logging event containing message to attached appender(s) without further checks.
void fatal(const std::string &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for FATAL ev...
void log(const LevelPtr &level, const std::wstring &message, const log4cxx::spi::LocationInfo &location) 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...
static bool isDebugEnabledFor(const LoggerPtr &logger)
Is logger is enabled for DEBUG level logging events?
Definition log4cxx/logger.h:1002
void warn(const std::wstring &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for WARN eve...
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 debug(const std::wstring &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for DEBUG ev...
void l7dlog(const LevelPtr &level, const std::wstring &key, const log4cxx::spi::LocationInfo &locationInfo) const
Add a new logging event containing locationInfo and the localized message key to attached appender(s)...
void l7dlog(const LevelPtr &level, const std::string &key, const log4cxx::spi::LocationInfo &locationInfo, const std::string &val1, const std::string &val2) const
Add a new logging event containing locationInfo and the localized message key using parameters val1 a...
static bool isFatalEnabledFor(const LoggerPtr &logger)
Is logger is enabled for FATAL level logging events?
Definition log4cxx/logger.h:1114
static LoggerPtr getLogger(const CFStringRef &name)
Retrieve a logger by name.
static LoggerPtr getLogger(const std::wstring &name, const log4cxx::spi::LoggerFactoryPtr &factory)
Like getLogger except that the type of logger instantiated depends on the type returned by the Logger...
void error(const CFStringRef &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
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 forcedLogLS(const LevelPtr &level, const LogString &message, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing message and location to attached appender(s) without further check...
Logger(const LogString &name)
This constructor initializes a new logger instance and sets its name.
void changeParentTo(const LoggerPtr &otherLogger)
Definition log4cxx/logger.h:1542
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:1036
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?
const LevelPtr & getLevel() const
The assigned Level, if any, for this logger.
void removeHierarchy()
Only the Hierarchy class can remove the hierarchy of a logger.
void error(const std::string &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
void forcedLog(const LevelPtr &level, const std::wstring &message, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing message and location to attached appender(s) without further check...
void info(const std::wstring &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for INFO eve...
void getName(std::string &name) const
Put name of this logger into name in current encoding.
void forcedLog(const LevelPtr &level, const std::wstring &message) const
Add a new logging event containing message to attached appender(s) without further checks.
void fatal(const std::string &msg, const log4cxx::spi::LocationInfo &location) 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 log4cxx::spi::LocationInfo &location) const
Add a new logging event containing message and location to the appenders attached to this logger if t...
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...
void fatal(const CFStringRef &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
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 trace(const std::wstring &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for TRACE ev...
void log(const LevelPtr &level, const CFStringRef &message, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing message and location to the appenders attached to this logger if t...
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...
void trace(const CFStringRef &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for TRACE ev...
LoggerPtr getParent() const
The parent of this logger.
void updateThreshold()
Only the Hierarchy class can change the threshold of a logger.
void l7dlog(const LevelPtr &level, const std::wstring &key, const log4cxx::spi::LocationInfo &locationInfo, const std::wstring &val1, const std::wstring &val2) const
Add a new logging event containing locationInfo and the localized message key using parameters val1 a...
void l7dlog(const LevelPtr &level, const LogString &key, const log4cxx::spi::LocationInfo &locationInfo, const std::vector< LogString > &values) const
Add a new logging event containing locationInfo and the localized message key using values for parame...
void forcedLog(const LevelPtr &level, const std::string &message, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing message and location to attached appender(s) without further check...
void l7dlog(const LevelPtr &level, const std::wstring &key, const log4cxx::spi::LocationInfo &locationInfo, 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,...
void l7dlog(const LevelPtr &level, const std::string &key, const log4cxx::spi::LocationInfo &locationInfo) const
Add a new logging event containing locationInfo and the localized message key to attached appender(s)...
void closeNestedAppenders()
Close all attached appenders implementing the AppenderAttachable interface.
void info(const CFStringRef &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for INFO eve...
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 info(const CFStringRef &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for INFO eve...
void debug(const std::wstring &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
void l7dlog(const LevelPtr &level, const CFStringRef &key, const log4cxx::spi::LocationInfo &locationInfo, 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,...
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...
bool replaceAppender(const AppenderPtr &oldAppender, const AppenderPtr &newAppender) override
Replace oldAppender with newAppender.
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...
void trace(const CFStringRef &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for TRACE ev...
bool isThresholdValid() const
Is m_threshold the same as getEffectiveLevel()->toInt().
void removeAppender(const AppenderPtr appender) override
Remove the appender passed as parameter form the list of appenders.
static bool isTraceEnabledFor(const LoggerPtr &logger)
Is logger is enabled for TRACE level logging events?
Definition log4cxx/logger.h:1140
void l7dlog(const LevelPtr &level, const CFStringRef &key, const log4cxx::spi::LocationInfo &locationInfo, const CFStringRef &val1) const
Add a new logging event containing locationInfo and the localized message key using parameter val to ...
void debug(const std::string &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for DEBUG ev...
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 addAppender(const AppenderPtr newAppender) override
Add newAppender to the list of appenders of this Logger instance.
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...
void forcedLog(const LevelPtr &level, const std::string &message) const
Add a new logging event containing message to attached appender(s) without further checks.
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:33
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
const struct __CFString * CFStringRef
Definition logstring.h:30
LOG4CXX_PTR_DEF(LoggerRepository)
std::shared_ptr< LoggerRepository > LoggerRepositoryPtr
Definition repositoryselector.h:28
std::shared_ptr< LoggingEvent > LoggingEventPtr
Definition appender.h:32
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 logmanager.h:28
std::vector< LoggerPtr > LoggerList
Definition logmanager.h:29
#define LOG4CXX_CAST_ENTRY(Interface)
Definition object.h:154
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)
Definition object.h:37
#define END_LOG4CXX_CAST_MAP()
Definition object.h:148
#define BEGIN_LOG4CXX_CAST_MAP()
Definition object.h:142