Apache Log4cxx  Version 1.6.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>
28
29namespace LOG4CXX_NS
30{
31
32namespace spi
33{
34class LoggerRepository;
36class LoggerFactory;
38}
39
40class Logger;
44
45
50class LOG4CXX_EXPORT Logger
51 : public virtual spi::AppenderAttachable
52{
53 public:
59
60 private:
61 LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(LoggerPrivate, m_priv)
62 int m_threshold;
63
64 public:
71 Logger(const LogString& name);
72#if LOG4CXX_ABI_VERSION <= 15
73 [[ deprecated( "Pool is no longer required" ) ]]
74 Logger(helpers::Pool& pool, const LogString& name);
75#endif
77
78
86 void addAppender(const AppenderPtr newAppender) override;
87
88
102
108
122 void debug(const std::string& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
137 void debug(const std::string& msg) const;
138#if LOG4CXX_WCHAR_T_API
154 void debug(const std::wstring& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
169 void debug(const std::wstring& msg) const;
170#endif
171#if LOG4CXX_UNICHAR_API
187 void debug(const std::basic_string<UniChar>& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
202 void debug(const std::basic_string<UniChar>& msg) const;
203#endif
204#if LOG4CXX_CFSTRING_API
220 void debug(const CFStringRef& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
235 void debug(const CFStringRef& msg) const;
236#endif
237
253 void error(const std::string& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
268 void error(const std::string& msg) const;
269#if LOG4CXX_WCHAR_T_API
284 void error(const std::wstring& msg) const;
300 void error(const std::wstring& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
301#endif
302#if LOG4CXX_UNICHAR_API
318 void error(const std::basic_string<UniChar>& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
333 void error(const std::basic_string<UniChar>& msg) const;
334#endif
335#if LOG4CXX_CFSTRING_API
351 void error(const CFStringRef& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
366 void error(const CFStringRef& msg) const;
367#endif
368
384 void fatal(const std::string& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
399 void fatal(const std::string& msg) const;
400#if LOG4CXX_WCHAR_T_API
416 void fatal(const std::wstring& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
431 void fatal(const std::wstring& msg) const;
432#endif
433#if LOG4CXX_UNICHAR_API
449 void fatal(const std::basic_string<UniChar>& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
464 void fatal(const std::basic_string<UniChar>& msg) const;
465#endif
466#if LOG4CXX_CFSTRING_API
482 void fatal(const CFStringRef& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
497 void fatal(const CFStringRef& msg) const;
498#endif
499
507 void addEvent(const LevelPtr& level, std::string&& message
509
517 void addEvent(const LevelPtr& level, helpers::AsyncBuffer&& messageAppender
518 , const spi::LocationInfo& sourceLocation = spi::LocationInfo::getLocationUnavailable()) const;
519
526 void addFatalEvent(std::string&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
527
535
542 void addErrorEvent(std::string&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
543
551
558 void addWarnEvent(std::string&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
559
567
574 void addInfoEvent(std::string&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
575
583
590 void addDebugEvent(std::string&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
591
599
606 void addTraceEvent(std::string&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
607
615
623 void forcedLog(const LevelPtr& level, const std::string& message,
624 const LOG4CXX_NS::spi::LocationInfo& location) const;
631 void forcedLog(const LevelPtr& level, const std::string& message) const;
632
633#if LOG4CXX_WCHAR_T_API
641 void addEvent(const LevelPtr& level, std::wstring&& message
643
650 void addFatalEvent(std::wstring&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
651
658 void addErrorEvent(std::wstring&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
659
666 void addWarnEvent(std::wstring&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
667
674 void addInfoEvent(std::wstring&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
675
682 void addDebugEvent(std::wstring&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
683
690 void addTraceEvent(std::wstring&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
691
699 void forcedLog(const LevelPtr& level, const std::wstring& message,
700 const LOG4CXX_NS::spi::LocationInfo& location) const;
707 void forcedLog(const LevelPtr& level, const std::wstring& message) const;
708#endif
709#if LOG4CXX_UNICHAR_API
717 void addEvent(const LevelPtr& level, std::basic_string<UniChar>&& message,
725 void addFatalEvent(std::basic_string<UniChar>&& message,const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
732 void addErrorEvent(std::basic_string<UniChar>&& message,const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
739 void addWarnEvent(std::basic_string<UniChar>&& message,const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
746 void addInfoEvent(std::basic_string<UniChar>&& message,const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
753 void addDebugEvent(std::basic_string<UniChar>&& message,const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
760 void addTraceEvent(std::basic_string<UniChar>&& message,const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
761
769 void forcedLog(const LevelPtr& level, const std::basic_string<UniChar>& message,
770 const LOG4CXX_NS::spi::LocationInfo& location) const;
777 void forcedLog(const LevelPtr& level, const std::basic_string<UniChar>& message) const;
778#endif
779#if LOG4CXX_CFSTRING_API
787 void forcedLog(const LevelPtr& level, const CFStringRef& message,
788 const LOG4CXX_NS::spi::LocationInfo& location) const;
795 void forcedLog(const LevelPtr& level, const CFStringRef& message) const;
796#endif
804 void addEventLS(const LevelPtr& level, LogString&& message
806
814 void forcedLogLS(const LevelPtr& level, const LogString& message,
815 const LOG4CXX_NS::spi::LocationInfo& location) const;
816
820 bool getAdditivity() const;
821
827 AppenderList getAllAppenders() const override;
828
833 AppenderPtr getAppender(const LogString& name) const override;
834
844 virtual const LevelPtr& getEffectiveLevel() const;
845
846#if LOG4CXX_ABI_VERSION <= 15
852#endif
853
858 const LogString& getName() const;
859
864 void getName(std::string& name) const;
865#if LOG4CXX_WCHAR_T_API
870 void getName(std::wstring& name) const;
871#endif
872#if LOG4CXX_UNICHAR_API
877 void getName(std::basic_string<UniChar>& name) const;
878#endif
879#if LOG4CXX_CFSTRING_API
884 void getName(CFStringRef& name) const;
885#endif
886
894
895
901 const LevelPtr& getLevel() const;
902
903#if 15 < LOG4CXX_ABI_VERSION
908#endif
909
914 static LoggerPtr getLogger(const std::string& name);
919 static LoggerPtr getLogger(const char* const name);
920#if LOG4CXX_WCHAR_T_API
925 static LoggerPtr getLogger(const std::wstring& name);
930 static LoggerPtr getLogger(const wchar_t* const name);
931#endif
932#if LOG4CXX_UNICHAR_API
937 static LoggerPtr getLogger(const std::basic_string<UniChar>& name);
938#endif
939#if LOG4CXX_CFSTRING_API
944 static LoggerPtr getLogger(const CFStringRef& name);
945#endif
950 static LoggerPtr getLoggerLS(const LogString& name);
951
956
970 static LoggerPtr getLoggerLS(const LogString& name,
971 const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
985 static LoggerPtr getLogger(const std::string& name,
986 const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
987#if LOG4CXX_WCHAR_T_API
1001 static LoggerPtr getLogger(const std::wstring& name,
1002 const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
1003#endif
1004#if LOG4CXX_UNICHAR_API
1018 static LoggerPtr getLogger(const std::basic_string<UniChar>& name,
1019 const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
1020#endif
1021#if LOG4CXX_CFSTRING_API
1035 static LoggerPtr getLogger(const CFStringRef& name,
1036 const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
1037#endif
1038
1048 helpers::ResourceBundlePtr getResourceBundle() const;
1049
1050 protected:
1061
1062 public:
1078 void info(const std::string& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1093 void info(const std::string& msg) const;
1094#if LOG4CXX_WCHAR_T_API
1110 void info(const std::wstring& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1125 void info(const std::wstring& msg) const;
1126#endif
1127#if LOG4CXX_UNICHAR_API
1141 void info(const std::basic_string<UniChar>& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1156 void info(const std::basic_string<UniChar>& msg) const;
1157#endif
1158#if LOG4CXX_CFSTRING_API
1174 void info(const CFStringRef& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1189 void info(const CFStringRef& msg) const;
1190#endif
1191
1195 bool isAttached(const AppenderPtr appender) const override;
1196
1231 bool isDebugEnabled() const;
1232
1254 inline static bool isDebugEnabledFor(const LoggerPtr& logger)
1255 {
1256 return logger && logger->m_threshold <= Level::DEBUG_INT && logger->isDebugEnabled();
1257 }
1258
1264 bool isEnabledFor(const LevelPtr& level) const;
1265
1266
1276 bool isInfoEnabled() const;
1277
1288 inline static bool isInfoEnabledFor(const LoggerPtr& logger)
1289 {
1290 return logger && logger->m_threshold <= Level::INFO_INT && logger->isInfoEnabled();
1291 }
1292
1302 bool isWarnEnabled() const;
1303
1314 inline static bool isWarnEnabledFor(const LoggerPtr& logger)
1315 {
1316 return logger && logger->m_threshold <= Level::WARN_INT && logger->isWarnEnabled();
1317 }
1318
1328 bool isErrorEnabled() const;
1329
1340 inline static bool isErrorEnabledFor(const LoggerPtr& logger)
1341 {
1342 return logger && logger->m_threshold <= Level::ERROR_INT && logger->isErrorEnabled();
1343 }
1344
1354 bool isFatalEnabled() const;
1355
1366 inline static bool isFatalEnabledFor(const LoggerPtr& logger)
1367 {
1368 return logger && logger->m_threshold <= Level::FATAL_INT && logger->isFatalEnabled();
1369 }
1370
1380 bool isTraceEnabled() const;
1381
1392 inline static bool isTraceEnabledFor(const LoggerPtr& logger)
1393 {
1394 return logger && logger->m_threshold <= Level::TRACE_INT && logger->isTraceEnabled();
1395 }
1396
1415 void l7dlog(const LevelPtr& level, const LogString& key,
1416 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1417 const std::vector<LogString>& values) const;
1433 void l7dlog(const LevelPtr& level, const std::string& key,
1434 const LOG4CXX_NS::spi::LocationInfo& locationInfo) const;
1452 void l7dlog(const LevelPtr& level, const std::string& key,
1453 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1454 const std::string& val) const;
1473 void l7dlog(const LevelPtr& level, const std::string& key,
1474 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1475 const std::string& val1, const std::string& val2) const;
1495 void l7dlog(const LevelPtr& level, const std::string& key,
1496 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1497 const std::string& val1, const std::string& val2, const std::string& val3) const;
1498
1499#if LOG4CXX_WCHAR_T_API
1515 void l7dlog(const LevelPtr& level, const std::wstring& key,
1516 const LOG4CXX_NS::spi::LocationInfo& locationInfo) const;
1534 void l7dlog(const LevelPtr& level, const std::wstring& key,
1535 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1536 const std::wstring& val) const;
1555 void l7dlog(const LevelPtr& level, const std::wstring& key,
1556 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1557 const std::wstring& val1, const std::wstring& val2) const;
1577 void l7dlog(const LevelPtr& level, const std::wstring& key,
1578 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1579 const std::wstring& val1, const std::wstring& val2, const std::wstring& val3) const;
1580#endif
1581#if LOG4CXX_UNICHAR_API
1597 void l7dlog(const LevelPtr& level, const std::basic_string<UniChar>& key,
1598 const LOG4CXX_NS::spi::LocationInfo& locationInfo) const;
1616 void l7dlog(const LevelPtr& level, const std::basic_string<UniChar>& key,
1617 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1618 const std::basic_string<UniChar>& val) const;
1637 void l7dlog(const LevelPtr& level, const std::basic_string<UniChar>& key,
1638 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1639 const std::basic_string<UniChar>& val1, const std::basic_string<UniChar>& val2) const;
1659 void l7dlog(const LevelPtr& level, const std::basic_string<UniChar>& key,
1660 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1661 const std::basic_string<UniChar>& val1, const std::basic_string<UniChar>& val2,
1662 const std::basic_string<UniChar>& val3) const;
1663#endif
1664#if LOG4CXX_CFSTRING_API
1680 void l7dlog(const LevelPtr& level, const CFStringRef& key,
1681 const LOG4CXX_NS::spi::LocationInfo& locationInfo) const;
1699 void l7dlog(const LevelPtr& level, const CFStringRef& key,
1700 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1701 const CFStringRef& val1) const;
1720 void l7dlog(const LevelPtr& level, const CFStringRef& key,
1721 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1722 const CFStringRef& val1, const CFStringRef& val2) const;
1742 void l7dlog(const LevelPtr& level, const CFStringRef& key,
1743 const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1744 const CFStringRef& val1, const CFStringRef& val2,
1745 const CFStringRef& val3) const;
1746#endif
1747
1756 void log(const LevelPtr& level, const std::string& message,
1757 const LOG4CXX_NS::spi::LocationInfo& location) const;
1766 void log(const LevelPtr& level, const std::string& message) const;
1767#if LOG4CXX_WCHAR_T_API
1776 void log(const LevelPtr& level, const std::wstring& message,
1777 const LOG4CXX_NS::spi::LocationInfo& location) const;
1786 void log(const LevelPtr& level, const std::wstring& message) const;
1787#endif
1788#if LOG4CXX_UNICHAR_API
1797 void log(const LevelPtr& level, const std::basic_string<UniChar>& message,
1798 const LOG4CXX_NS::spi::LocationInfo& location) const;
1807 void log(const LevelPtr& level, const std::basic_string<UniChar>& message) const;
1808#endif
1809#if LOG4CXX_CFSTRING_API
1818 void log(const LevelPtr& level, const CFStringRef& message,
1819 const LOG4CXX_NS::spi::LocationInfo& location) const;
1828 void log(const LevelPtr& level, const CFStringRef& message) const;
1829#endif
1838 void logLS(const LevelPtr& level, const LogString& message,
1839 const LOG4CXX_NS::spi::LocationInfo& location) const;
1840
1841
1842
1848 void removeAllAppenders() override;
1849
1853 void removeAppender(const AppenderPtr appender) override;
1854
1859 void removeAppender(const LogString& name) override;
1860
1865 bool replaceAppender(const AppenderPtr& oldAppender, const AppenderPtr& newAppender) LOG4CXX_16_VIRTUAL_SPECIFIER;
1866
1870 void replaceAppenders(const AppenderList& newList) LOG4CXX_16_VIRTUAL_SPECIFIER;
1871
1875 void setAdditivity(bool additive);
1876
1877 protected:
1878 friend class Hierarchy;
1890 void setParent(LoggerPtr parentLogger);
1895
1896 private:
1897 spi::LoggerRepository* getHierarchy() const;
1898
1899 public:
1906 virtual void setLevel(const LevelPtr level);
1907
1911 void setResourceBundle(const helpers::ResourceBundlePtr& bundle);
1912
1913#if LOG4CXX_WCHAR_T_API
1929 void warn(const std::wstring& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1944 void warn(const std::wstring& msg) const;
1945#endif
1946#if LOG4CXX_UNICHAR_API
1962 void warn(const std::basic_string<UniChar>& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1977 void warn(const std::basic_string<UniChar>& msg) const;
1978#endif
1979#if LOG4CXX_CFSTRING_API
1995 void warn(const CFStringRef& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
2010 void warn(const CFStringRef& msg) const;
2011#endif
2027 void warn(const std::string& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
2042 void warn(const std::string& msg) const;
2043
2044#if LOG4CXX_WCHAR_T_API
2060 void trace(const std::wstring& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
2075 void trace(const std::wstring& msg) const;
2076#endif
2077#if LOG4CXX_UNICHAR_API
2093 void trace(const std::basic_string<UniChar>& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
2108 void trace(const std::basic_string<UniChar>& msg) const;
2109#endif
2110#if LOG4CXX_CFSTRING_API
2126 void trace(const CFStringRef& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
2141 void trace(const CFStringRef& msg) const;
2142#endif
2158 void trace(const std::string& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
2173 void trace(const std::string& msg) const;
2174
2182 void reconfigure( const AppenderList& newList, bool newAdditivity );
2183
2184 private:
2185 //
2186 // prevent copy and assignment
2187 Logger(const Logger&);
2188 Logger& operator=(const Logger&);
2189};
2191}
2192
2193#if !defined(LOG4CXX_UNLIKELY)
2194 #if __GNUC__ >= 3
2201 #define LOG4CXX_UNLIKELY(expr) __builtin_expect(expr, 0)
2202 #else
2209 #define LOG4CXX_UNLIKELY(expr) expr
2210 #endif
2211#endif
2212
2213#if defined(LOG4CXX_ENABLE_STACKTRACE) && !defined(LOG4CXX_STACKTRACE)
2214 #ifndef __has_include
2215 #include <boost/stacktrace.hpp>
2216 #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + boost::stacktrace::to_string(boost::stacktrace::stacktrace()));
2217 #elif __has_include(<stacktrace>)
2218 #include <stacktrace>
2219 #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + std::stacktrace::to_string(std::stacktrace::stacktrace()));
2220 #elif __has_include(<boost/stacktrace.hpp>)
2221 #include <boost/stacktrace.hpp>
2222 #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + boost::stacktrace::to_string(boost::stacktrace::stacktrace()));
2223 #else
2224 #warning "Stacktrace requested but no implementation found"
2225 #endif
2226#endif /* LOG4CXX_ENABLE_STACKTRACE */
2227
2228#if !defined(LOG4CXX_STACKTRACE)
2229#define LOG4CXX_STACKTRACE
2230#endif
2231
2232#ifndef LOG4CXX_FMT_VA_ARG
2233#if __cplusplus >= 202002L
2234 #define LOG4CXX_FMT_VA_ARG(...) __VA_OPT__(,) __VA_ARGS__
2235#else
2236 #define LOG4CXX_FMT_VA_ARG(...) , __VA_ARGS__
2237#endif
2238#endif
2239
2243
2251#define LOG4CXX_LOG(logger, level, message) do { \
2252 if (logger->isEnabledFor(level)) {\
2253 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2254 logger->addEvent(level, oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2255
2264#define LOG4CXX_LOG_FMT(logger, level, fmt, ...) do { \
2265 if (logger->isEnabledFor(level)) {\
2266 logger->addEvent(level, ::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__) ), LOG4CXX_LOCATION); }} while (0)
2267
2275#define LOG4CXX_LOGLS(logger, level, message) do { \
2276 if (logger->isEnabledFor(level)) {\
2277 ::LOG4CXX_NS::helpers::LogCharMessageBuffer oss_; \
2278 logger->addEvent(level, oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2279
2280#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 10000
2300#define LOG4CXX_DEBUG(logger, message) do { \
2301 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isDebugEnabledFor(logger))) {\
2302 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2303 logger->addDebugEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2304
2324#define LOG4CXX_DEBUG_FMT(logger, fmt, ...) do { \
2325 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isDebugEnabledFor(logger))) {\
2326 logger->addDebugEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__) ), LOG4CXX_LOCATION); }} while (0)
2327#else
2328#define LOG4CXX_DEBUG(logger, message)
2329#define LOG4CXX_DEBUG_FMT(logger, fmt, ...)
2330#endif
2331
2332#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 5000
2344#define LOG4CXX_TRACE(logger, message) do { \
2345 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isTraceEnabledFor(logger))) {\
2346 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2347 logger->addTraceEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2348
2361#define LOG4CXX_TRACE_FMT(logger, fmt, ...) do { \
2362 if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isTraceEnabledFor(logger))) {\
2363 logger->addTraceEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2364#else
2365#define LOG4CXX_TRACE(logger, message)
2366#define LOG4CXX_TRACE_FMT(logger, fmt, ...)
2367#endif
2368
2369#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 20000
2386#define LOG4CXX_INFO(logger, message) do { \
2387 if (::LOG4CXX_NS::Logger::isInfoEnabledFor(logger)) {\
2388 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2389 logger->addInfoEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2390
2407#define LOG4CXX_INFO_FMT(logger, fmt, ...) do { \
2408 if (::LOG4CXX_NS::Logger::isInfoEnabledFor(logger)) {\
2409 logger->addInfoEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2410#else
2411#define LOG4CXX_INFO(logger, message)
2412#define LOG4CXX_INFO_FMT(logger, fmt, ...)
2413#endif
2414
2415#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 30000
2430#define LOG4CXX_WARN(logger, message) do { \
2431 if (::LOG4CXX_NS::Logger::isWarnEnabledFor(logger)) {\
2432 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2433 logger->addWarnEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2434
2450#define LOG4CXX_WARN_FMT(logger, fmt, ...) do { \
2451 if (::LOG4CXX_NS::Logger::isWarnEnabledFor(logger)) {\
2452 logger->addWarnEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2453#else
2454#define LOG4CXX_WARN(logger, message)
2455#define LOG4CXX_WARN_FMT(logger, fmt, ...)
2456#endif
2457
2458#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 40000
2473#define LOG4CXX_ERROR(logger, message) do { \
2474 if (::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2475 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2476 logger->addErrorEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2477
2493#define LOG4CXX_ERROR_FMT(logger, fmt, ...) do { \
2494 if (::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2495 logger->addErrorEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2496
2504#define LOG4CXX_ASSERT(logger, condition, message) do { \
2505 if (!(condition) && ::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2506 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2507 LOG4CXX_STACKTRACE \
2508 logger->addErrorEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2509
2520#define LOG4CXX_ASSERT_FMT(logger, condition, fmt, ...) do { \
2521 if (!(condition) && ::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2522 LOG4CXX_STACKTRACE \
2523 logger->addErrorEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2524
2525#else
2526#define LOG4CXX_ERROR(logger, message)
2527#define LOG4CXX_ERROR_FMT(logger, fmt, ...)
2528#define LOG4CXX_ASSERT(logger, condition, message)
2529#define LOG4CXX_ASSERT_FMT(logger, condition, fmt, ...)
2530#endif
2531
2532#if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 50000
2544#define LOG4CXX_FATAL(logger, message) do { \
2545 if (::LOG4CXX_NS::Logger::isFatalEnabledFor(logger)) {\
2546 ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2547 logger->addFatalEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2548
2561#define LOG4CXX_FATAL_FMT(logger, fmt, ...) do { \
2562 if (::LOG4CXX_NS::Logger::isFatalEnabledFor(logger)) {\
2563 logger->addFatalEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2564#else
2565#define LOG4CXX_FATAL(logger, message)
2566#define LOG4CXX_FATAL_FMT(logger, fmt, ...)
2567#endif
2568
2576#define LOG4CXX_L7DLOG(logger, level, key) do { \
2577 if (logger->isEnabledFor(level)) {\
2578 logger->l7dlog(level, key, LOG4CXX_LOCATION); }} while (0)
2579
2588#define LOG4CXX_L7DLOG1(logger, level, key, p1) do { \
2589 if (logger->isEnabledFor(level)) {\
2590 logger->l7dlog(level, key, LOG4CXX_LOCATION, p1); }} while (0)
2591
2601#define LOG4CXX_L7DLOG2(logger, level, key, p1, p2) do { \
2602 if (logger->isEnabledFor(level)) {\
2603 logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2); }} while (0)
2604
2615#define LOG4CXX_L7DLOG3(logger, level, key, p1, p2, p3) do { \
2616 if (logger->isEnabledFor(level)) {\
2617 logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2, p3); }} while (0)
2618
2620
2622
2623#endif //_LOG4CXX_LOGGER_H
#define LOG4CXX_16_VIRTUAL_SPECIFIER
Definition appenderattachable.h:99
@ DEBUG_INT
Definition level.h:216
@ WARN_INT
Definition level.h:214
@ INFO_INT
Definition level.h:215
@ ERROR_INT
Definition level.h:213
@ FATAL_INT
Definition level.h:212
@ TRACE_INT
Definition level.h:217
This is the central class in the log4cxx package.
Definition log4cxx/logger.h:52
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 addWarnEvent(std::wstring &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new warning level logging event containing message and location to attached appender(s) without...
void addDebugEvent(std::wstring &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new debug level logging event containing message and location to attached appender(s) without f...
void removeAllAppenders() override
Remove all previously added appenders from this logger instance.
static LoggerPtr getLogger(const std::string &name, const log4cxx::spi::LoggerFactoryPtr &factory)
Like getLogger except that the type of logger instantiated depends on the type returned by the Logger...
void warn(const std::wstring &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for WARN eve...
void l7dlog(const LevelPtr &level, const std::string &key, const log4cxx::spi::LocationInfo &locationInfo, const std::string &val1, const std::string &val2, const std::string &val3) const
Add a new logging event containing locationInfo and the localized message key using parameters val1,...
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...
friend class Hierarchy
Definition log4cxx/logger.h:1878
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:1340
void addDebugEvent(helpers::AsyncBuffer &&messageAppender, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add to attached appender(s) a new DEBUG level LoggingEvent which was requested at sourceLocation wher...
void 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)
void addEvent(const LevelPtr &level, std::wstring &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing message and location to attached appender(s) without further check...
void warn(const std::string &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for WARN eve...
void error(const std::wstring &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for ERROR ev...
void 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 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 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 logLS(const LevelPtr &level, const LogString &message, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing message and location to the appenders attached to this logger if t...
static LoggerPtr getLogger(const char *const name)
Retrieve a logger by name in current encoding.
bool isInfoEnabled() const
Is this logger is enabled for INFO level logging events?
void trace(const std::string &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for TRACE ev...
void addInfoEvent(std::string &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new info level logging event containing message and location to attached appender(s) without fu...
bool isAttached(const AppenderPtr appender) const override
Is appender attached to this logger?
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.
void addTraceEvent(std::wstring &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new trace level logging event containing message and location to attached appender(s) without f...
bool isWarnEnabled() const
Is this logger is enabled for WARN level logging events?
void l7dlog(const LevelPtr &level, const std::wstring &key, const log4cxx::spi::LocationInfo &locationInfo, const std::wstring &val) const
Add a new logging event containing locationInfo and the localized message key using parameter val to ...
spi::LoggerRepository * getLoggerRepository() const
Return the the LoggerRepository where this Logger is attached.
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 FATAL 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 addEvent(const LevelPtr &level, helpers::AsyncBuffer &&messageAppender, const spi::LocationInfo &sourceLocation=spi::LocationInfo::getLocationUnavailable()) const
Add to attached appender(s) a new level LoggingEvent which was requested at sourceLocation where the ...
void addEventLS(const LevelPtr &level, LogString &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new logging event containing message and location to attached appender(s) without further check...
void log(const LevelPtr &level, const std::string &message) const
Add a new logging event containing message to the appenders attached to this logger if this logger is...
void 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) without further check...
void fatal(const std::wstring &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for FATAL ev...
static LoggerPtr getLogger(const CFStringRef &name, const log4cxx::spi::LoggerFactoryPtr &factory)
Like getLogger except that the type of logger instantiated depends on the type returned by the Logger...
const LogString & getName() const
Get the logger name.
LogString getResourceBundleString(const LogString &key) const
Returns the string resource corresponding to key in this logger's inherited resource bundle.
bool isEnabledFor(const LevelPtr &level) const
Is this logger is enabled for logging events at level?
static LoggerPtr getLogger(const wchar_t *const name)
Retrieve a logger by name.
void debug(const std::string &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
void addFatalEvent(std::wstring &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new fatal level logging event containing message and location to attached appender(s) without f...
void debug(const CFStringRef &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
void info(const std::string &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for INFO eve...
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 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.
static bool isWarnEnabledFor(const LoggerPtr &logger)
Is logger is enabled for WARN level logging events?
Definition log4cxx/logger.h:1314
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) without further check...
void error(const std::wstring &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
void warn(const std::string &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for WARN eve...
void replaceAppenders(const AppenderList &newList) LOG4CXX_16_VIRTUAL_SPECIFIER
Replace all previously added appenders with newList.
void l7dlog(const LevelPtr &level, const std::string &key, const log4cxx::spi::LocationInfo &locationInfo, const std::string &val) const
Add a new logging event containing locationInfo and the localized message key using parameter val to ...
void warn(const CFStringRef &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for WARN eve...
void addFatalEvent(helpers::AsyncBuffer &&messageAppender, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add to attached appender(s) a new FATAL level LoggingEvent which was requested at sourceLocation wher...
void 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 forcedLog(const LevelPtr &level, const CFStringRef &message, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing message and location to attached appender(s) without further check...
void forcedLog(const LevelPtr &level, const CFStringRef &message) const
Add a new logging event containing message to attached appender(s) without further checks.
void 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...
void fatal(const std::string &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for FATAL ev...
void log(const LevelPtr &level, const std::wstring &message, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing message and location to the appenders attached to this logger if t...
void addErrorEvent(std::wstring &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new error level logging event containing message and location to attached appender(s) without f...
static bool isDebugEnabledFor(const LoggerPtr &logger)
Is logger is enabled for DEBUG level logging events?
Definition log4cxx/logger.h:1254
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 callAppenders(const spi::LoggingEventPtr &event, helpers::Pool &p) const
Call the appenders in the hierrachy starting at this.
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:1366
static LoggerPtr getLogger(const CFStringRef &name)
Retrieve a logger by name.
static LoggerPtr getLogger(const std::wstring &name, const log4cxx::spi::LoggerFactoryPtr &factory)
Like getLogger except that the type of logger instantiated depends on the type returned by the Logger...
void error(const CFStringRef &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
void addInfoEvent(helpers::AsyncBuffer &&messageAppender, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add to attached appender(s) a new INFO level LoggingEvent which was requested at sourceLocation where...
void 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 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...
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 FATAL ev...
Logger(const LogString &name)
This constructor initializes a new logger instance and sets its name.
void addFatalEvent(std::string &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new fatal level logging event containing message and location to attached appender(s) without f...
static bool isInfoEnabledFor(const LoggerPtr &logger)
Is logger is enabled for INFO level logging events?
Definition log4cxx/logger.h:1288
static LoggerPtr getLogger(const std::string &name)
Retrieve a logger by name in current encoding.
bool replaceAppender(const AppenderPtr &oldAppender, const AppenderPtr &newAppender) LOG4CXX_16_VIRTUAL_SPECIFIER
Replace oldAppender with newAppender.
bool isDebugEnabled() const
Is this logger is enabled for DEBUG level logging events?
const LevelPtr & getLevel() const
The assigned Level, if any, for this logger.
void removeHierarchy()
Only the Hierarchy class can remove the hierarchy of a logger.
void error(const std::string &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg and location to attached appender(s) if this logger is enabled...
void forcedLog(const LevelPtr &level, const std::wstring &message, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing message and location to attached appender(s) without further check...
void info(const std::wstring &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for INFO eve...
void getName(std::string &name) const
Put name of this logger into name in current encoding.
void forcedLog(const LevelPtr &level, const std::wstring &message) const
Add a new logging event containing message to attached appender(s) without further checks.
void 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 addErrorEvent(helpers::AsyncBuffer &&messageAppender, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add to attached appender(s) a new ERROR level LoggingEvent which was requested at sourceLocation wher...
void fatal(const 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 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 addTraceEvent(helpers::AsyncBuffer &&messageAppender, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add to attached appender(s) a new TRACE level LoggingEvent which was requested at sourceLocation wher...
void 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 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) without further check...
void l7dlog(const LevelPtr &level, const std::wstring &key, const log4cxx::spi::LocationInfo &locationInfo, const std::wstring &val1, const std::wstring &val2, const std::wstring &val3) const
Add a new logging event containing locationInfo and the localized message key using parameters val1,...
void l7dlog(const LevelPtr &level, const std::string &key, const log4cxx::spi::LocationInfo &locationInfo) const
Add a new logging event containing locationInfo and the localized message key to attached appender(s)...
void closeNestedAppenders()
Close all attached appenders implementing the AppenderAttachable interface.
void info(const CFStringRef &msg, const log4cxx::spi::LocationInfo &location) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for INFO eve...
void addErrorEvent(std::string &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new error level logging event containing message and location to attached appender(s) without f...
void reconfigure(const AppenderList &newList, bool newAdditivity)
Replace all current appenders with newList and set the additivity flag to newAdditivity.
void info(const 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 addWarnEvent(helpers::AsyncBuffer &&messageAppender, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add to attached appender(s) a new WARN level LoggingEvent which was requested at sourceLocation where...
void getName(std::basic_string< UniChar > &name) const
Put name of this logger into name.
void addInfoEvent(std::wstring &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new info level logging event containing message and location to attached appender(s) without fu...
void addDebugEvent(std::string &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new debug level logging event containing message and location to attached appender(s) without f...
void trace(const CFStringRef &msg) const
Add a new logging event containing msg to attached appender(s) if this logger is enabled for TRACE ev...
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:1392
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...
bool isErrorEnabled() const
Is this logger is enabled for ERROR level logging events?
void addAppender(const AppenderPtr newAppender) override
Add newAppender to the list of appenders of this Logger instance.
void addTraceEvent(std::string &&message, const spi::LocationInfo &location=spi::LocationInfo::getLocationUnavailable()) const
Add a new trace level logging event containing message and location to attached appender(s) without f...
void forcedLog(const LevelPtr &level, const std::string &message) const
Add a new logging event containing message to attached appender(s) without further checks.
bool isTraceEnabled() const
Is this logger is enabled for TRACE level logging events?
This class is used by the LOG4CXX_INFO_ASYNC and similar macros to support insertion operators.
Definition asyncbuffer.h:46
Definition pool.h:33
This Interface is for attaching Appenders to objects.
Definition appenderattachable.h:33
This class represents the location of a logging statement.
Definition locationinfo.h:40
static const LocationInfo & getLocationUnavailable()
Implement this interface to create new instances of Logger or a sub-class of Logger.
Definition loggerfactory.h:33
A LoggerRepository is used to create and retrieve Loggers.
Definition loggerrepository.h:43
const struct __CFString * CFStringRef
Definition logstring.h:30
std::shared_ptr< LoggerRepository > LoggerRepositoryPtr
Definition optionconverter.h:33
LOG4CXX_PTR_DEF(LoggerRepository)
std::shared_ptr< LoggingEvent > LoggingEventPtr
Definition appender.h:32
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:154
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)
Definition object.h:37
#define END_LOG4CXX_CAST_MAP()
Definition object.h:148
#define BEGIN_LOG4CXX_CAST_MAP()
Definition object.h:142