|
Apache Log4cxx
Version 1.5.0
|
Go to the documentation of this file.
18 #ifndef _LOG4CXX_LOGGER_H
19 #define _LOG4CXX_LOGGER_H
33 class LoggerRepository;
60 LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(LoggerPrivate, m_priv)
71 #if LOG4CXX_ABI_VERSION <= 15
72 [[ deprecated(
"Pool is no longer required" ) ]]
121 void debug(
const std::string& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
136 void debug(
const std::string& msg)
const;
137 #if LOG4CXX_WCHAR_T_API
153 void debug(
const std::wstring& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
168 void debug(
const std::wstring& msg)
const;
170 #if LOG4CXX_UNICHAR_API
186 void debug(
const std::basic_string<UniChar>& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
201 void debug(
const std::basic_string<UniChar>& msg)
const;
203 #if LOG4CXX_CFSTRING_API
252 void error(
const std::string& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
267 void error(
const std::string& msg)
const;
268 #if LOG4CXX_WCHAR_T_API
283 void error(
const std::wstring& msg)
const;
299 void error(
const std::wstring& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
301 #if LOG4CXX_UNICHAR_API
317 void error(
const std::basic_string<UniChar>& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
332 void error(
const std::basic_string<UniChar>& msg)
const;
334 #if LOG4CXX_CFSTRING_API
383 void fatal(
const std::string& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
398 void fatal(
const std::string& msg)
const;
399 #if LOG4CXX_WCHAR_T_API
415 void fatal(
const std::wstring& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
430 void fatal(
const std::wstring& msg)
const;
432 #if LOG4CXX_UNICHAR_API
448 void fatal(
const std::basic_string<UniChar>& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
463 void fatal(
const std::basic_string<UniChar>& msg)
const;
465 #if LOG4CXX_CFSTRING_API
507 ,
const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable())
const;
565 const LOG4CXX_NS::spi::LocationInfo& location)
const;
574 #if LOG4CXX_WCHAR_T_API
583 ,
const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable())
const;
641 const LOG4CXX_NS::spi::LocationInfo& location)
const;
650 #if LOG4CXX_UNICHAR_API
659 const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable())
const;
711 const LOG4CXX_NS::spi::LocationInfo& location)
const;
720 #if LOG4CXX_CFSTRING_API
729 const LOG4CXX_NS::spi::LocationInfo& location)
const;
746 ,
const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable())
const;
756 const LOG4CXX_NS::spi::LocationInfo& location)
const;
804 #if LOG4CXX_WCHAR_T_API
811 #if LOG4CXX_UNICHAR_API
816 void getName(std::basic_string<UniChar>& name)
const;
818 #if LOG4CXX_CFSTRING_API
852 #if LOG4CXX_WCHAR_T_API
864 #if LOG4CXX_UNICHAR_API
871 #if LOG4CXX_CFSTRING_API
919 #if LOG4CXX_WCHAR_T_API
936 #if LOG4CXX_UNICHAR_API
953 #if LOG4CXX_CFSTRING_API
1010 void info(
const std::string& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
1025 void info(
const std::string& msg)
const;
1026 #if LOG4CXX_WCHAR_T_API
1042 void info(
const std::wstring& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
1057 void info(
const std::wstring& msg)
const;
1059 #if LOG4CXX_UNICHAR_API
1073 void info(
const std::basic_string<UniChar>& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
1088 void info(
const std::basic_string<UniChar>& msg)
const;
1090 #if LOG4CXX_CFSTRING_API
1188 return logger && logger->m_threshold <= Level::DEBUG_INT && logger->isDebugEnabled();
1222 return logger && logger->m_threshold <= Level::INFO_INT && logger->isInfoEnabled();
1248 return logger && logger->m_threshold <= Level::WARN_INT && logger->isWarnEnabled();
1274 return logger && logger->m_threshold <= Level::ERROR_INT && logger->isErrorEnabled();
1300 return logger && logger->m_threshold <= Level::FATAL_INT && logger->isFatalEnabled();
1326 return logger && logger->m_threshold <= Level::TRACE_INT && logger->isTraceEnabled();
1348 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1349 const std::vector<LogString>& values)
const;
1366 const LOG4CXX_NS::spi::LocationInfo& locationInfo)
const;
1385 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1386 const std::string& val)
const;
1406 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1407 const std::string& val1,
const std::string& val2)
const;
1428 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1429 const std::string& val1,
const std::string& val2,
const std::string& val3)
const;
1431 #if LOG4CXX_WCHAR_T_API
1448 const LOG4CXX_NS::spi::LocationInfo& locationInfo)
const;
1467 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1468 const std::wstring& val)
const;
1488 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1489 const std::wstring& val1,
const std::wstring& val2)
const;
1510 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1511 const std::wstring& val1,
const std::wstring& val2,
const std::wstring& val3)
const;
1513 #if LOG4CXX_UNICHAR_API
1530 const LOG4CXX_NS::spi::LocationInfo& locationInfo)
const;
1549 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1550 const std::basic_string<UniChar>& val)
const;
1570 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1571 const std::basic_string<UniChar>& val1,
const std::basic_string<UniChar>& val2)
const;
1592 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1593 const std::basic_string<UniChar>& val1,
const std::basic_string<UniChar>& val2,
1594 const std::basic_string<UniChar>& val3)
const;
1596 #if LOG4CXX_CFSTRING_API
1613 const LOG4CXX_NS::spi::LocationInfo& locationInfo)
const;
1632 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1653 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1675 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1689 const LOG4CXX_NS::spi::LocationInfo& location)
const;
1699 #if LOG4CXX_WCHAR_T_API
1709 const LOG4CXX_NS::spi::LocationInfo& location)
const;
1720 #if LOG4CXX_UNICHAR_API
1729 void log(
const LevelPtr& level,
const std::basic_string<UniChar>& message,
1730 const LOG4CXX_NS::spi::LocationInfo& location)
const;
1739 void log(
const LevelPtr& level,
const std::basic_string<UniChar>& message)
const;
1741 #if LOG4CXX_CFSTRING_API
1751 const LOG4CXX_NS::spi::LocationInfo& location)
const;
1771 const LOG4CXX_NS::spi::LocationInfo& location)
const;
1845 #if LOG4CXX_WCHAR_T_API
1861 void warn(
const std::wstring& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
1876 void warn(
const std::wstring& msg)
const;
1878 #if LOG4CXX_UNICHAR_API
1894 void warn(
const std::basic_string<UniChar>& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
1909 void warn(
const std::basic_string<UniChar>& msg)
const;
1911 #if LOG4CXX_CFSTRING_API
1959 void warn(
const std::string& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
1974 void warn(
const std::string& msg)
const;
1976 #if LOG4CXX_WCHAR_T_API
1992 void trace(
const std::wstring& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
2007 void trace(
const std::wstring& msg)
const;
2009 #if LOG4CXX_UNICHAR_API
2025 void trace(
const std::basic_string<UniChar>& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
2040 void trace(
const std::basic_string<UniChar>& msg)
const;
2042 #if LOG4CXX_CFSTRING_API
2090 void trace(
const std::string& msg,
const LOG4CXX_NS::spi::LocationInfo& location)
const;
2105 void trace(
const std::string& msg)
const;
2125 #if !defined(LOG4CXX_UNLIKELY)
2133 #define LOG4CXX_UNLIKELY(expr) __builtin_expect(expr, 0)
2141 #define LOG4CXX_UNLIKELY(expr) expr
2145 #if defined(LOG4CXX_ENABLE_STACKTRACE) && !defined(LOG4CXX_STACKTRACE)
2146 #ifndef __has_include
2147 #include <boost/stacktrace.hpp>
2148 #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + boost::stacktrace::to_string(boost::stacktrace::stacktrace()));
2149 #elif __has_include(<stacktrace>)
2150 #include <stacktrace>
2151 #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + std::stacktrace::to_string(std::stacktrace::stacktrace()));
2152 #elif __has_include(<boost/stacktrace.hpp>)
2153 #include <boost/stacktrace.hpp>
2154 #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + boost::stacktrace::to_string(boost::stacktrace::stacktrace()));
2156 #warning "Stacktrace requested but no implementation found"
2160 #if !defined(LOG4CXX_STACKTRACE)
2161 #define LOG4CXX_STACKTRACE
2164 #ifndef LOG4CXX_FMT_VA_ARG
2165 #if __cplusplus >= 202002L
2166 #define LOG4CXX_FMT_VA_ARG(...) __VA_OPT__(,) __VA_ARGS__
2168 #define LOG4CXX_FMT_VA_ARG(...) , __VA_ARGS__
2183 #define LOG4CXX_LOG(logger, level, message) do { \
2184 if (logger->isEnabledFor(level)) {\
2185 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2186 logger->addEvent(level, oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2196 #define LOG4CXX_LOG_FMT(logger, level, fmt, ...) do { \
2197 if (logger->isEnabledFor(level)) {\
2198 logger->addEvent(level, ::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__) ), LOG4CXX_LOCATION); }} while (0)
2207 #define LOG4CXX_LOGLS(logger, level, message) do { \
2208 if (logger->isEnabledFor(level)) {\
2209 ::LOG4CXX_NS::helpers::LogCharMessageBuffer oss_; \
2210 logger->addEvent(level, oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2212 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 10000
2232 #define LOG4CXX_DEBUG(logger, message) do { \
2233 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isDebugEnabledFor(logger))) {\
2234 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2235 logger->addDebugEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2256 #define LOG4CXX_DEBUG_FMT(logger, fmt, ...) do { \
2257 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isDebugEnabledFor(logger))) {\
2258 logger->addDebugEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__) ), LOG4CXX_LOCATION); }} while (0)
2260 #define LOG4CXX_DEBUG(logger, message)
2261 #define LOG4CXX_DEBUG_FMT(logger, fmt, ...)
2264 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 5000
2276 #define LOG4CXX_TRACE(logger, message) do { \
2277 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isTraceEnabledFor(logger))) {\
2278 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2279 logger->addTraceEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2293 #define LOG4CXX_TRACE_FMT(logger, fmt, ...) do { \
2294 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isTraceEnabledFor(logger))) {\
2295 logger->addTraceEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2297 #define LOG4CXX_TRACE(logger, message)
2298 #define LOG4CXX_TRACE_FMT(logger, fmt, ...)
2301 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 20000
2318 #define LOG4CXX_INFO(logger, message) do { \
2319 if (::LOG4CXX_NS::Logger::isInfoEnabledFor(logger)) {\
2320 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2321 logger->addInfoEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2339 #define LOG4CXX_INFO_FMT(logger, fmt, ...) do { \
2340 if (::LOG4CXX_NS::Logger::isInfoEnabledFor(logger)) {\
2341 logger->addInfoEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2343 #define LOG4CXX_INFO(logger, message)
2344 #define LOG4CXX_INFO_FMT(logger, fmt, ...)
2347 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 30000
2362 #define LOG4CXX_WARN(logger, message) do { \
2363 if (::LOG4CXX_NS::Logger::isWarnEnabledFor(logger)) {\
2364 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2365 logger->addWarnEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2382 #define LOG4CXX_WARN_FMT(logger, fmt, ...) do { \
2383 if (::LOG4CXX_NS::Logger::isWarnEnabledFor(logger)) {\
2384 logger->addWarnEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2386 #define LOG4CXX_WARN(logger, message)
2387 #define LOG4CXX_WARN_FMT(logger, fmt, ...)
2390 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 40000
2405 #define LOG4CXX_ERROR(logger, message) do { \
2406 if (::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2407 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2408 logger->addErrorEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2425 #define LOG4CXX_ERROR_FMT(logger, fmt, ...) do { \
2426 if (::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2427 logger->addErrorEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2436 #define LOG4CXX_ASSERT(logger, condition, message) do { \
2437 if (!(condition) && ::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2438 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2439 LOG4CXX_STACKTRACE \
2440 logger->addErrorEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2452 #define LOG4CXX_ASSERT_FMT(logger, condition, fmt, ...) do { \
2453 if (!(condition) && ::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2454 LOG4CXX_STACKTRACE \
2455 logger->addErrorEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2458 #define LOG4CXX_ERROR(logger, message)
2459 #define LOG4CXX_ERROR_FMT(logger, fmt, ...)
2460 #define LOG4CXX_ASSERT(logger, condition, message)
2461 #define LOG4CXX_ASSERT_FMT(logger, condition, fmt, ...)
2464 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 50000
2476 #define LOG4CXX_FATAL(logger, message) do { \
2477 if (::LOG4CXX_NS::Logger::isFatalEnabledFor(logger)) {\
2478 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2479 logger->addFatalEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2493 #define LOG4CXX_FATAL_FMT(logger, fmt, ...) do { \
2494 if (::LOG4CXX_NS::Logger::isFatalEnabledFor(logger)) {\
2495 logger->addFatalEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2497 #define LOG4CXX_FATAL(logger, message)
2498 #define LOG4CXX_FATAL_FMT(logger, fmt, ...)
2508 #define LOG4CXX_L7DLOG(logger, level, key) do { \
2509 if (logger->isEnabledFor(level)) {\
2510 logger->l7dlog(level, key, LOG4CXX_LOCATION); }} while (0)
2520 #define LOG4CXX_L7DLOG1(logger, level, key, p1) do { \
2521 if (logger->isEnabledFor(level)) {\
2522 logger->l7dlog(level, key, LOG4CXX_LOCATION, p1); }} while (0)
2533 #define LOG4CXX_L7DLOG2(logger, level, key, p1, p2) do { \
2534 if (logger->isEnabledFor(level)) {\
2535 logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2); }} while (0)
2547 #define LOG4CXX_L7DLOG3(logger, level, key, p1, p2, p3) do { \
2548 if (logger->isEnabledFor(level)) {\
2549 logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2, p3); }} while (0)
2555 #endif //_LOG4CXX_LOGGER_H
void replaceAppenders(const AppenderList &newList) LOG4CXX_16_VIRTUAL_SPECIFIER
Replace all previously added appenders with newList.
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 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 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 LoggerPtr getLogger(const std::basic_string< UniChar > &name, const log4cxx::spi::LoggerFactoryPtr &factory)
Like getLogger except that the type of logger instantiated depends on the type returned by the Logger...
bool isAttached(const AppenderPtr appender) const override
Is appender attached to this logger?
void fatal(const std::basic_string< UniChar > &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,...
std::basic_string< logchar > LogString
Definition: logstring.h:60
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...
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 error(const std::basic_string< UniChar > &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for ERROR ev...
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...
static bool isFatalEnabledFor(const LoggerPtr &logger)
Is logger is enabled for FATAL level logging events?
Definition: log4cxx/logger.h:1298
const LogString & getName() const
Get the logger name.
void warn(const std::basic_string< UniChar > &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...
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...
Implement this interface to create new instances of Logger or a sub-class of Logger.
Definition: loggerfactory.h:33
static bool isTraceEnabledFor(const LoggerPtr &logger)
Is logger is enabled for TRACE level logging events?
Definition: log4cxx/logger.h:1324
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::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 log(const LevelPtr &level, const std::basic_string< UniChar > &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 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 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 fatal(const std::basic_string< UniChar > &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for FATAL ev...
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...
#define BEGIN_LOG4CXX_CAST_MAP()
Definition: object.h:146
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 getAdditivity() const
Get the additivity flag for this logger.
void warn(const std::basic_string< UniChar > &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...
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 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...
bool isWarnEnabled() const
Is this logger is enabled for WARN level logging events?
static LoggerPtr getLogger(const wchar_t *const name)
Retrieve a logger by name.
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 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 addErrorEvent(std::basic_string< UniChar > &&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 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...
void reconfigure(const AppenderList &newList, bool newAdditivity)
Replace all current appenders with newList and set the additivity flag to newAdditivity.
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 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...
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...
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...
const LevelPtr & getLevel() const
The assigned Level, if any, for this logger.
bool isFatalEnabled() const
Is this logger is enabled for FATAL level logging events?
void getName(std::basic_string< UniChar > &name) const
Put name of this logger into name.
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...
static bool isInfoEnabledFor(const LoggerPtr &logger)
Is logger is enabled for INFO level logging events?
Definition: log4cxx/logger.h:1220
static LoggerPtr getLogger(const std::string &name)
Retrieve a logger by name in current encoding.
#define END_LOG4CXX_CAST_MAP()
Definition: object.h:152
static LoggerPtr getLogger(const CFStringRef &name)
Retrieve a logger by name.
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...
const struct __CFString * CFStringRef
Definition: logstring.h:30
void log(const LevelPtr &level, const std::basic_string< UniChar > &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 addDebugEvent(std::basic_string< UniChar > &&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 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...
This Interface is for attaching Appenders to objects.
Definition: appenderattachable.h:33
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 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 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 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...
static LoggerPtr getLogger(const std::wstring &name)
Retrieve a logger by name.
std::shared_ptr< Level > LevelPtr
Definition: optionconverter.h:27
AppenderList getAllAppenders() const override
Get the appenders contained in this logger as an AppenderList.
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...
This class is specialized in retrieving loggers by name and also maintaining the logger hierarchy.
Definition: hierarchy.h:52
AppenderPtr getAppender(const LogString &name) const override
Look for the appender named as name.
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 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...
bool isDebugEnabled() const
Is this logger is enabled for DEBUG level logging events?
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 trace(const std::basic_string< UniChar > &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for TRACE ev...
void l7dlog(const LevelPtr &level, const std::basic_string< UniChar > &key, const log4cxx::spi::LocationInfo &locationInfo, const std::basic_string< UniChar > &val1, const std::basic_string< UniChar > &val2, const std::basic_string< UniChar > &val3) const
Add a new logging event containing locationInfo and the localized message key using parameters val1,...
LOG4CXX_PTR_DEF(Logger)
smart pointer to a Logger class
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 getName(std::string &name) const
Put name of this logger into name in current encoding.
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...
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 std::basic_string< UniChar > &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for DEBUG ev...
std::vector< LoggerPtr > LoggerList
Definition: logmanager.h:29
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...
static LoggerPtr getLoggerLS(const LogString &name)
Retrieve a logger by name in Unicode.
#define LOG4CXX_16_VIRTUAL_SPECIFIER
Definition: appenderattachable.h:99
void forcedLog(const LevelPtr &level, const CFStringRef &message) const
Add a new logging event containing message to attached appender(s) without further checks.
A LoggerRepository is used to create and retrieve Loggers.
Definition: loggerrepository.h:43
bool isTraceEnabled() const
Is this logger is enabled for TRACE level logging events?
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...
Logger(const LogString &name)
This constructor initializes a new logger instance and sets its name.
std::shared_ptr< Appender > AppenderPtr
Definition: basicconfigurator.h:28
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 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)...
std::shared_ptr< LoggingEvent > LoggingEventPtr
Definition: appender.h:31
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 trace(const CFStringRef &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::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 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...
void getName(std::wstring &name) const
Put name of this logger into name.
void error(const std::basic_string< UniChar > &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...
static bool isErrorEnabledFor(const LoggerPtr &logger)
Is logger is enabled for ERROR level logging events?
Definition: log4cxx/logger.h:1272
Logger(helpers::Pool &pool, const LogString &name)
static LoggerPtr getLogger(const char *const name)
Retrieve a logger by name in current encoding.
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...
LoggerPtr getParent() const
The parent of this logger.
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 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...
static LoggerPtr getRootLogger()
Retrieve the root logger.
void removeAppender(const LogString &name) override
Remove the appender with the name passed as parameter form the list of appenders.
void l7dlog(const LevelPtr &level, const std::basic_string< UniChar > &key, const log4cxx::spi::LocationInfo &locationInfo) const
Add a new logging event containing locationInfo and the localized message key to attached appender(s)...
void callAppenders(const spi::LoggingEventPtr &event, helpers::Pool &p) const
Call the appenders in the hierrachy starting at this.
void removeHierarchy()
Only the Hierarchy class can remove the hierarchy of a logger.
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...
This class represents the location of a logging statement.
Definition: locationinfo.h:40
void getName(CFStringRef &name) const
Put name of this logger into name.
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 addWarnEvent(std::basic_string< UniChar > &&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 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 closeNestedAppenders()
Close all attached appenders implementing the AppenderAttachable interface.
std::shared_ptr< LoggerFactory > LoggerFactoryPtr
Definition: logmanager.h:33
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 addTraceEvent(std::basic_string< UniChar > &&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 removeAllAppenders() override
Remove all previously added appenders from this logger instance.
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 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,...
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)
Definition: object.h:39
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 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 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 setResourceBundle(const helpers::ResourceBundlePtr &bundle)
Set the resource bundle to be used with localized logging methods.
void l7dlog(const LevelPtr &level, const std::basic_string< UniChar > &key, const log4cxx::spi::LocationInfo &locationInfo, const std::basic_string< UniChar > &val) const
Add a new logging event containing locationInfo and the localized message key using parameter val to ...
This is the central class in the log4cxx package.
Definition: log4cxx/logger.h:51
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 removeAppender(const AppenderPtr appender) override
Remove the appender passed as parameter form the list of appenders.
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 std::basic_string< UniChar > &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for INFO eve...
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...
void forcedLog(const LevelPtr &level, const std::string &message) const
Add a new logging event containing message to attached appender(s) without further checks.
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 addAppender(const AppenderPtr newAppender) override
Add newAppender to the list of appenders of this Logger instance.
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 addEvent(const LevelPtr &level, std::basic_string< UniChar > &&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 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...
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 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...
void l7dlog(const LevelPtr &level, const std::basic_string< UniChar > &key, const log4cxx::spi::LocationInfo &locationInfo, const std::basic_string< UniChar > &val1, const std::basic_string< UniChar > &val2) const
Add a new logging event containing locationInfo and the localized message key using parameters val1 a...
bool isErrorEnabled() const
Is this logger is enabled for ERROR level logging events?
void forcedLog(const LevelPtr &level, const std::basic_string< UniChar > &message, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing message and location to attached appender(s) without further check...
void addInfoEvent(std::basic_string< UniChar > &&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 isInfoEnabled() const
Is this logger is enabled for INFO level logging events?
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...
bool isEnabledFor(const LevelPtr &level) const
Is this logger is enabled for logging events at level?
void setAdditivity(bool additive)
Set the additivity flag for this logger.
void updateThreshold()
Only the Hierarchy class can change the threshold of a logger.
bool replaceAppender(const AppenderPtr &oldAppender, const AppenderPtr &newAppender) LOG4CXX_16_VIRTUAL_SPECIFIER
Replace oldAppender with newAppender.
static bool isWarnEnabledFor(const LoggerPtr &logger)
Is logger is enabled for WARN level logging events?
Definition: log4cxx/logger.h:1246
void trace(const std::basic_string< UniChar > &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 forcedLog(const LevelPtr &level, const std::basic_string< UniChar > &message) const
Add a new logging event containing message to attached appender(s) without further checks.
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...
static bool isDebugEnabledFor(const LoggerPtr &logger)
Is logger is enabled for DEBUG level logging events?
Definition: log4cxx/logger.h:1186
LOG4CXX_LIST_DEF(LoggerList, LoggerPtr)
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 error(const CFStringRef &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for ERROR ev...
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 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 ...
virtual void setLevel(const LevelPtr level)
Set the level of this logger.
std::shared_ptr< Logger > LoggerPtr
Definition: defaultloggerfactory.h:26
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 debug(const std::basic_string< UniChar > &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 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 setParent(LoggerPtr parentLogger)
Only the Hierarchy class can set the parent of a 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 setHierarchy(spi::LoggerRepository *repository)
Only the Hierarchy class can set the hierarchy of a logger.
helpers::ResourceBundlePtr getResourceBundle() const
Return the inherited ResourceBundle for this logger.
static LoggerPtr getLogger(const std::basic_string< UniChar > &name)
Retrieve a logger by name.
void addFatalEvent(std::basic_string< UniChar > &&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 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::basic_string< UniChar > &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...
spi::LoggerRepository * getLoggerRepository() const
Return the the LoggerRepository where this Logger is attached.
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 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...
#define LOG4CXX_CAST_ENTRY(Interface)
Definition: object.h:158
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 info(const CFStringRef &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for INFO eve...
LogString getResourceBundleString(const LogString &key) const
Returns the string resource corresponding to key in this logger's inherited resource bundle.