Apache Log4cxx  Version 1.2.0
Loading...
Searching...
No Matches
log4cxx/logger.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef _LOG4CXX_LOGGER_H
19#define _LOG4CXX_LOGGER_H
20
22#include <log4cxx/level.h>
27
28namespace LOG4CXX_NS
29{
30
31namespace spi
32{
33class LoggerRepository;
35class LoggerFactory;
37}
38
39class Logger;
43
44
49class LOG4CXX_EXPORT Logger :
50 public virtual LOG4CXX_NS::spi::AppenderAttachable
51{
52 public:
58
59 private:
60 LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(LoggerPrivate, m_priv)
61 int m_threshold;
62
63 public:
73 Logger(helpers::Pool& pool, const LogString& name);
74
76
77
85 void addAppender(const AppenderPtr newAppender) override;
86
87
100 void callAppenders(const LOG4CXX_NS::spi::LoggingEventPtr& event, LOG4CXX_NS::helpers::Pool& p) const;
101
107
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;
169#endif
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;
202#endif
203#if LOG4CXX_CFSTRING_API
219 void debug(const CFStringRef& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
234 void debug(const CFStringRef& msg) const;
235#endif
236
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;
300#endif
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;
333#endif
334#if LOG4CXX_CFSTRING_API
350 void error(const CFStringRef& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
365 void error(const CFStringRef& msg) const;
366#endif
367
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;
431#endif
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;
464#endif
465#if LOG4CXX_CFSTRING_API
481 void fatal(const CFStringRef& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
496 void fatal(const CFStringRef& msg) const;
497#endif
498
506 void addEvent(const LevelPtr& level, std::string&& message
507 , const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
508
516 void forcedLog(const LevelPtr& level, const std::string& message,
517 const LOG4CXX_NS::spi::LocationInfo& location) const;
524 void forcedLog(const LevelPtr& level, const std::string& message) const;
525
526#if LOG4CXX_WCHAR_T_API
534 void addEvent(const LevelPtr& level, std::wstring&& message
535 , const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
536
544 void forcedLog(const LevelPtr& level, const std::wstring& message,
545 const LOG4CXX_NS::spi::LocationInfo& location) const;
552 void forcedLog(const LevelPtr& level, const std::wstring& message) const;
553#endif
554#if LOG4CXX_UNICHAR_API
562 void addEvent(const LevelPtr& level, std::basic_string<UniChar>&& message,
563 const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
571 void forcedLog(const LevelPtr& level, const std::basic_string<UniChar>& message,
572 const LOG4CXX_NS::spi::LocationInfo& location) const;
579 void forcedLog(const LevelPtr& level, const std::basic_string<UniChar>& message) const;
580#endif
581#if LOG4CXX_CFSTRING_API
589 void forcedLog(const LevelPtr& level, const CFStringRef& message,
590 const LOG4CXX_NS::spi::LocationInfo& location) const;
597 void forcedLog(const LevelPtr& level, const CFStringRef& message) const;
598#endif
606 void addEventLS(const LevelPtr& level, LogString&& message
607 , const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
608
616 void forcedLogLS(const LevelPtr& level, const LogString& message,
617 const LOG4CXX_NS::spi::LocationInfo& location) const;
618
622 bool getAdditivity() const;
623
629 AppenderList getAllAppenders() const override;
630
635 AppenderPtr getAppender(const LogString& name) const override;
636
646 virtual const LevelPtr& getEffectiveLevel() const;
647
652 LOG4CXX_NS::spi::LoggerRepository* getLoggerRepository() const;
653
654
659 const LogString& getName() const;
660
665 void getName(std::string& name) const;
666#if LOG4CXX_WCHAR_T_API
671 void getName(std::wstring& name) const;
672#endif
673#if LOG4CXX_UNICHAR_API
678 void getName(std::basic_string<UniChar>& name) const;
679#endif
680#if LOG4CXX_CFSTRING_API
685 void getName(CFStringRef& name) const;
686#endif
687
695
696
702 const LevelPtr& getLevel() const;
703
708 static LoggerPtr getLogger(const std::string& name);
713 static LoggerPtr getLogger(const char* const name);
714#if LOG4CXX_WCHAR_T_API
719 static LoggerPtr getLogger(const std::wstring& name);
724 static LoggerPtr getLogger(const wchar_t* const name);
725#endif
726#if LOG4CXX_UNICHAR_API
731 static LoggerPtr getLogger(const std::basic_string<UniChar>& name);
732#endif
733#if LOG4CXX_CFSTRING_API
738 static LoggerPtr getLogger(const CFStringRef& name);
739#endif
744 static LoggerPtr getLoggerLS(const LogString& name);
745
750
764 static LoggerPtr getLoggerLS(const LogString& name,
765 const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
779 static LoggerPtr getLogger(const std::string& name,
780 const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
781#if LOG4CXX_WCHAR_T_API
795 static LoggerPtr getLogger(const std::wstring& name,
796 const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
797#endif
798#if LOG4CXX_UNICHAR_API
812 static LoggerPtr getLogger(const std::basic_string<UniChar>& name,
813 const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
814#endif
815#if LOG4CXX_CFSTRING_API
829 static LoggerPtr getLogger(const CFStringRef& name,
830 const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
831#endif
832
842 helpers::ResourceBundlePtr getResourceBundle() const;
843
844 protected:
855
856 public:
872 void info(const std::string& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
887 void info(const std::string& msg) const;
888#if LOG4CXX_WCHAR_T_API
904 void info(const std::wstring& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
919 void info(const std::wstring& msg) const;
920#endif
921#if LOG4CXX_UNICHAR_API
935 void info(const std::basic_string<UniChar>& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
950 void info(const std::basic_string<UniChar>& msg) const;
951#endif
952#if LOG4CXX_CFSTRING_API
968 void info(const CFStringRef& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
983 void info(const CFStringRef& msg) const;
984#endif
985
989 bool isAttached(const AppenderPtr appender) const override;
990
1025 bool isDebugEnabled() const;
1026
1048 inline static bool isDebugEnabledFor(const LoggerPtr& logger)
1049 {
1050 return logger && logger->m_threshold <= Level::DEBUG_INT && logger->isDebugEnabled();
1051 }
1052
1058 bool isEnabledFor(const LevelPtr& level) const;
1059
1060
1070 bool isInfoEnabled() const;
1071
1082 inline static bool isInfoEnabledFor(const LoggerPtr& logger)
1083 {
1084 return logger && logger->m_threshold <= Level::INFO_INT && logger->isInfoEnabled();
1085 }
1086
1096 bool isWarnEnabled() const;
1097
1108 inline static bool isWarnEnabledFor(const LoggerPtr& logger)
1109 {
1110 return logger && logger->m_threshold <= Level::WARN_INT && logger->isWarnEnabled();
1111 }
1112
1122 bool isErrorEnabled() const;
1123
1134 inline static bool isErrorEnabledFor(const LoggerPtr& logger)
1135 {
1136 return logger && logger->m_threshold <= Level::ERROR_INT && logger->isErrorEnabled();
1137 }
1138
1148 bool isFatalEnabled() const;
1149
1160 inline static bool isFatalEnabledFor(const LoggerPtr& logger)
1161 {
1162 return logger && logger->m_threshold <= Level::FATAL_INT && logger->isFatalEnabled();
1163 }
1164
1174 bool isTraceEnabled() const;
1175
1186 inline static bool isTraceEnabledFor(const LoggerPtr& logger)
1187 {
1188 return logger && logger->m_threshold <= Level::TRACE_INT && logger->isTraceEnabled();
1189 }
1190
1209 void l7dlog(const LevelPtr& level, const LogString& key,
1210 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1211 const std::vector<LogString>& values) const;
1227 void l7dlog(const LevelPtr& level, const std::string& key,
1228 const LOG4CXX_NS::spi::LocationInfo& locationInfo) const;
1246 void l7dlog(const LevelPtr& level, const std::string& key,
1247 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1248 const std::string& val) const;
1267 void l7dlog(const LevelPtr& level, const std::string& key,
1268 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1269 const std::string& val1, const std::string& val2) const;
1289 void l7dlog(const LevelPtr& level, const std::string& key,
1290 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1291 const std::string& val1, const std::string& val2, const std::string& val3) const;
1292
1293#if LOG4CXX_WCHAR_T_API
1309 void l7dlog(const LevelPtr& level, const std::wstring& key,
1310 const LOG4CXX_NS::spi::LocationInfo& locationInfo) const;
1328 void l7dlog(const LevelPtr& level, const std::wstring& key,
1329 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1330 const std::wstring& val) const;
1349 void l7dlog(const LevelPtr& level, const std::wstring& key,
1350 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1351 const std::wstring& val1, const std::wstring& val2) const;
1371 void l7dlog(const LevelPtr& level, const std::wstring& key,
1372 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1373 const std::wstring& val1, const std::wstring& val2, const std::wstring& val3) const;
1374#endif
1375#if LOG4CXX_UNICHAR_API
1391 void l7dlog(const LevelPtr& level, const std::basic_string<UniChar>& key,
1392 const LOG4CXX_NS::spi::LocationInfo& locationInfo) const;
1410 void l7dlog(const LevelPtr& level, const std::basic_string<UniChar>& key,
1411 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1412 const std::basic_string<UniChar>& val) const;
1431 void l7dlog(const LevelPtr& level, const std::basic_string<UniChar>& key,
1432 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1433 const std::basic_string<UniChar>& val1, const std::basic_string<UniChar>& val2) const;
1453 void l7dlog(const LevelPtr& level, const std::basic_string<UniChar>& key,
1454 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1455 const std::basic_string<UniChar>& val1, const std::basic_string<UniChar>& val2,
1456 const std::basic_string<UniChar>& val3) const;
1457#endif
1458#if LOG4CXX_CFSTRING_API
1474 void l7dlog(const LevelPtr& level, const CFStringRef& key,
1475 const LOG4CXX_NS::spi::LocationInfo& locationInfo) const;
1493 void l7dlog(const LevelPtr& level, const CFStringRef& key,
1494 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1495 const CFStringRef& val1) const;
1514 void l7dlog(const LevelPtr& level, const CFStringRef& key,
1515 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1516 const CFStringRef& val1, const CFStringRef& val2) const;
1536 void l7dlog(const LevelPtr& level, const CFStringRef& key,
1537 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1538 const CFStringRef& val1, const CFStringRef& val2,
1539 const CFStringRef& val3) const;
1540#endif
1541
1550 void log(const LevelPtr& level, const std::string& message,
1551 const LOG4CXX_NS::spi::LocationInfo& location) const;
1560 void log(const LevelPtr& level, const std::string& message) const;
1561#if LOG4CXX_WCHAR_T_API
1570 void log(const LevelPtr& level, const std::wstring& message,
1571 const LOG4CXX_NS::spi::LocationInfo& location) const;
1580 void log(const LevelPtr& level, const std::wstring& message) const;
1581#endif
1582#if LOG4CXX_UNICHAR_API
1591 void log(const LevelPtr& level, const std::basic_string<UniChar>& message,
1592 const LOG4CXX_NS::spi::LocationInfo& location) const;
1601 void log(const LevelPtr& level, const std::basic_string<UniChar>& message) const;
1602#endif
1603#if LOG4CXX_CFSTRING_API
1612 void log(const LevelPtr& level, const CFStringRef& message,
1613 const LOG4CXX_NS::spi::LocationInfo& location) const;
1622 void log(const LevelPtr& level, const CFStringRef& message) const;
1623#endif
1632 void logLS(const LevelPtr& level, const LogString& message,
1633 const LOG4CXX_NS::spi::LocationInfo& location) const;
1634
1635
1636
1642 void removeAllAppenders() override;
1643
1647 void removeAppender(const AppenderPtr appender) override;
1648
1653 void removeAppender(const LogString& name) override;
1654
1658 void setAdditivity(bool additive);
1659
1660 protected:
1661 friend class Hierarchy;
1673 void setParent(LoggerPtr parentLogger);
1678
1679 private:
1680 spi::LoggerRepository* getHierarchy() const;
1681
1682 public:
1689 virtual void setLevel(const LevelPtr level);
1690
1694 void setResourceBundle(const helpers::ResourceBundlePtr& bundle);
1695
1696#if LOG4CXX_WCHAR_T_API
1712 void warn(const std::wstring& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1727 void warn(const std::wstring& msg) const;
1728#endif
1729#if LOG4CXX_UNICHAR_API
1745 void warn(const std::basic_string<UniChar>& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1760 void warn(const std::basic_string<UniChar>& msg) const;
1761#endif
1762#if LOG4CXX_CFSTRING_API
1778 void warn(const CFStringRef& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1793 void warn(const CFStringRef& msg) const;
1794#endif
1810 void warn(const std::string& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1825 void warn(const std::string& msg) const;
1826
1827#if LOG4CXX_WCHAR_T_API
1843 void trace(const std::wstring& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1858 void trace(const std::wstring& msg) const;
1859#endif
1860#if LOG4CXX_UNICHAR_API
1876 void trace(const std::basic_string<UniChar>& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1891 void trace(const std::basic_string<UniChar>& msg) const;
1892#endif
1893#if LOG4CXX_CFSTRING_API
1909 void trace(const CFStringRef& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1924 void trace(const CFStringRef& msg) const;
1925#endif
1941 void trace(const std::string& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1956 void trace(const std::string& msg) const;
1957
1964 void reconfigure( const std::vector<AppenderPtr>& appenders, bool additivity );
1965
1966 private:
1967 //
1968 // prevent copy and assignment
1969 Logger(const Logger&);
1970 Logger& operator=(const Logger&);
1971};
1973}
1974
1979#if !defined(LOG4CXX_UNLIKELY)
1980 #if __GNUC__ >= 3
1987 #define LOG4CXX_UNLIKELY(expr) __builtin_expect(expr, 0)
1988 #else
1995 #define LOG4CXX_UNLIKELY(expr) expr
1996 #endif
1997#endif
1998
1999#if defined(LOG4CXX_ENABLE_STACKTRACE) && !defined(LOG4CXX_STACKTRACE)
2000 #ifndef __has_include
2001 #include <boost/stacktrace.hpp>
2002 #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + boost::stacktrace::to_string(boost::stacktrace::stacktrace()));
2003 #elif __has_include(<stacktrace>)
2004 #include <stacktrace>
2005 #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + std::stacktrace::to_string(std::stacktrace::stacktrace()));
2006 #elif __has_include(<boost/stacktrace.hpp>)
2007 #include <boost/stacktrace.hpp>
2008 #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + boost::stacktrace::to_string(boost::stacktrace::stacktrace()));
2009 #else
2010 #warning "Stacktrace requested but no implementation found"
2011 #endif
2012#endif /* LOG4CXX_ENABLE_STACKTRACE */
2013
2014#if !defined(LOG4CXX_STACKTRACE)
2015#define LOG4CXX_STACKTRACE
2016#endif
2017
2018
2026#define LOG4CXX_LOG(logger, level, message) do { \
2027 if (logger->isEnabledFor(level)) {\
2028 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2029 logger->addEvent(level, oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2030
2039#define LOG4CXX_LOG_FMT(logger, level, fmt, ...) do { \
2040 if (logger->isEnabledFor(level)) {\
2041 logger->addEvent(level, ::LOG4CXX_FORMAT_NS::format(fmt, __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)
2042
2050#define LOG4CXX_LOGLS(logger, level, message) do { \
2051 if (logger->isEnabledFor(level)) {\
2052 ::LOG4CXX_NS::helpers::LogCharMessageBuffer oss_; \
2053 logger->addEvent(level, oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2054
2055#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 10000
2075#define LOG4CXX_DEBUG(logger, message) do { \
2076 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isDebugEnabledFor(logger))) {\
2077 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2078 logger->addEvent(::LOG4CXX_NS::Level::getDebug(), oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2079
2099#define LOG4CXX_DEBUG_FMT(logger, fmt, ...) do { \
2100 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isDebugEnabledFor(logger))) {\
2101 logger->addEvent(::LOG4CXX_NS::Level::getDebug(), ::LOG4CXX_FORMAT_NS::format(fmt, __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)
2102#else
2103#define LOG4CXX_DEBUG(logger, message)
2104#define LOG4CXX_DEBUG_FMT(logger, fmt, ...)
2105#endif
2106
2107#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 5000
2119#define LOG4CXX_TRACE(logger, message) do { \
2120 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isTraceEnabledFor(logger))) {\
2121 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2122 logger->addEvent(::LOG4CXX_NS::Level::getTrace(), oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2123
2136#define LOG4CXX_TRACE_FMT(logger, fmt, ...) do { \
2137 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isTraceEnabledFor(logger))) {\
2138 logger->addEvent(::LOG4CXX_NS::Level::getTrace(), ::LOG4CXX_FORMAT_NS::format(fmt, __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)
2139#else
2140#define LOG4CXX_TRACE(logger, message)
2141#define LOG4CXX_TRACE_FMT(logger, fmt, ...)
2142#endif
2143
2144#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 20000
2161#define LOG4CXX_INFO(logger, message) do { \
2162 if (::LOG4CXX_NS::Logger::isInfoEnabledFor(logger)) {\
2163 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2164 logger->addEvent(::LOG4CXX_NS::Level::getInfo(), oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2165
2182#define LOG4CXX_INFO_FMT(logger, fmt, ...) do { \
2183 if (::LOG4CXX_NS::Logger::isInfoEnabledFor(logger)) {\
2184 logger->addEvent(::LOG4CXX_NS::Level::getInfo(), ::LOG4CXX_FORMAT_NS::format(fmt, __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)
2185#else
2186#define LOG4CXX_INFO(logger, message)
2187#define LOG4CXX_INFO_FMT(logger, fmt, ...)
2188#endif
2189
2190#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 30000
2205#define LOG4CXX_WARN(logger, message) do { \
2206 if (::LOG4CXX_NS::Logger::isWarnEnabledFor(logger)) {\
2207 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2208 logger->addEvent(::LOG4CXX_NS::Level::getWarn(), oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2209
2225#define LOG4CXX_WARN_FMT(logger, fmt, ...) do { \
2226 if (::LOG4CXX_NS::Logger::isWarnEnabledFor(logger)) {\
2227 logger->addEvent(::LOG4CXX_NS::Level::getWarn(), ::LOG4CXX_FORMAT_NS::format(fmt, __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)
2228#else
2229#define LOG4CXX_WARN(logger, message)
2230#define LOG4CXX_WARN_FMT(logger, fmt, ...)
2231#endif
2232
2233#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 40000
2248#define LOG4CXX_ERROR(logger, message) do { \
2249 if (::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2250 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2251 logger->addEvent(::LOG4CXX_NS::Level::getError(), oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2252
2268#define LOG4CXX_ERROR_FMT(logger, fmt, ...) do { \
2269 if (::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2270 logger->addEvent(::LOG4CXX_NS::Level::getError(), ::LOG4CXX_FORMAT_NS::format(fmt, __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)
2271
2279#define LOG4CXX_ASSERT(logger, condition, message) do { \
2280 if (!(condition) && ::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2281 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2282 LOG4CXX_STACKTRACE \
2283 logger->addEvent(::LOG4CXX_NS::Level::getError(), oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2284
2295#define LOG4CXX_ASSERT_FMT(logger, condition, fmt, ...) do { \
2296 if (!(condition) && ::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2297 LOG4CXX_STACKTRACE \
2298 logger->addEvent(::LOG4CXX_NS::Level::getError(), ::LOG4CXX_FORMAT_NS::format(fmt, __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)
2299
2300#else
2301#define LOG4CXX_ERROR(logger, message)
2302#define LOG4CXX_ERROR_FMT(logger, fmt, ...)
2303#define LOG4CXX_ASSERT(logger, condition, message)
2304#define LOG4CXX_ASSERT_FMT(logger, condition, fmt, ...)
2305#endif
2306
2307#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 50000
2319#define LOG4CXX_FATAL(logger, message) do { \
2320 if (::LOG4CXX_NS::Logger::isFatalEnabledFor(logger)) {\
2321 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2322 logger->addEvent(::LOG4CXX_NS::Level::getFatal(), oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2323
2336#define LOG4CXX_FATAL_FMT(logger, fmt, ...) do { \
2337 if (::LOG4CXX_NS::Logger::isFatalEnabledFor(logger)) {\
2338 logger->addEvent(::LOG4CXX_NS::Level::getFatal(), ::LOG4CXX_FORMAT_NS::format(fmt, __VA_ARGS__ ), LOG4CXX_LOCATION); }} while (0)
2339#else
2340#define LOG4CXX_FATAL(logger, message)
2341#define LOG4CXX_FATAL_FMT(logger, fmt, ...)
2342#endif
2343
2351#define LOG4CXX_L7DLOG(logger, level, key) do { \
2352 if (logger->isEnabledFor(level)) {\
2353 logger->l7dlog(level, key, LOG4CXX_LOCATION); }} while (0)
2354
2363#define LOG4CXX_L7DLOG1(logger, level, key, p1) do { \
2364 if (logger->isEnabledFor(level)) {\
2365 logger->l7dlog(level, key, LOG4CXX_LOCATION, p1); }} while (0)
2366
2376#define LOG4CXX_L7DLOG2(logger, level, key, p1, p2) do { \
2377 if (logger->isEnabledFor(level)) {\
2378 logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2); }} while (0)
2379
2390#define LOG4CXX_L7DLOG3(logger, level, key, p1, p2, p3) do { \
2391 if (logger->isEnabledFor(level)) {\
2392 logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2, p3); }} while (0)
2393
2397
2398#endif //_LOG4CXX_LOGGER_H
This class is specialized in retrieving loggers by name and also maintaining the logger hierarchy.
Definition: hierarchy.h:56
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...
static LoggerPtr getLogger(const std::basic_string< UniChar > &name)
Retrieve a logger by name.
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 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,...
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 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...
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:1134
void callAppenders(const log4cxx::spi::LoggingEventPtr &event, log4cxx::helpers::Pool &p) const
Call the appenders in the hierrachy starting at this.
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 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...
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...
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.
Logger(helpers::Pool &pool, const LogString &name)
This constructor initializes a new logger instance and sets its name.
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).
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 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,...
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...
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...
log4cxx::spi::LoggerRepository * getLoggerRepository() const
Return the the LoggerRepository where this Logger is attached.
bool isAttached(const AppenderPtr appender) const override
Is appender attached to this logger?
bool isFatalEnabled() const
Is this logger is enabled for FATAL level logging events?
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...
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.
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 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 fatal(const CFStringRef &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for ERROR ev...
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::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...
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).
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 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 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 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).
void fatal(const std::wstring &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for ERROR 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 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...
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).
void forcedLog(const LevelPtr &level, const std::basic_string< UniChar > &message) const
Add a new logging event containing message to attached appender(s).
static bool isWarnEnabledFor(const LoggerPtr &logger)
Is logger is enabled for WARN level logging events?
Definition: log4cxx/logger.h:1108
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 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).
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 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).
void forcedLog(const LevelPtr &level, const CFStringRef &message) const
Add a new logging event containing message to attached appender(s).
void fatal(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 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...
static bool isDebugEnabledFor(const LoggerPtr &logger)
Is logger is enabled for DEBUG level logging events?
Definition: log4cxx/logger.h:1048
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 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 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:1160
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 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).
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 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 ...
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 ERROR ev...
static bool isInfoEnabledFor(const LoggerPtr &logger)
Is logger is enabled for INFO level logging events?
Definition: log4cxx/logger.h:1082
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).
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).
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 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 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 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 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...
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).
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 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...
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 getName(std::basic_string< UniChar > &name) const
Put name of this logger into name.
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 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:1186
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...
void reconfigure(const std::vector< AppenderPtr > &appenders, bool additivity)
Reconfigure this logger by configuring all of the appenders.
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 forcedLog(const LevelPtr &level, const std::string &message) const
Add a new logging event containing message to attached appender(s).
bool isTraceEnabled() const
Is this logger is enabled for TRACE level logging events?
Definition: pool.h:33
This Interface is for attaching Appenders to objects.
Definition: appenderattachable.h:34
This class represents the location of a logging statement.
Definition: locationinfo.h:46
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_LIST_DEF(AppenderList, AppenderPtr)
std::basic_string< logchar > LogString
Definition: logstring.h:60
std::shared_ptr< Level > LevelPtr
Definition: optionconverter.h:28
LOG4CXX_PTR_DEF(Appender)
std::shared_ptr< Appender > AppenderPtr
Definition: basicconfigurator.h:29
std::shared_ptr< Logger > LoggerPtr
Definition: defaultloggerfactory.h:27
std::vector< LoggerPtr > LoggerList
Definition: logmanager.h:29
#define LOG4CXX_CAST_ENTRY(Interface)
Definition: object.h:158
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)
Definition: object.h:39
#define END_LOG4CXX_CAST_MAP()
Definition: object.h:152
#define BEGIN_LOG4CXX_CAST_MAP()
Definition: object.h:146