Apache Log4cxx  Version 1.5.0
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>
23 #include <log4cxx/helpers/pool.h>
27 
28 namespace LOG4CXX_NS
29 {
30 
31 namespace spi
32 {
33 class LoggerRepository;
35 class LoggerFactory;
37 }
38 
39 class Logger;
43 
44 
49 class LOG4CXX_EXPORT Logger
50  : public virtual spi::AppenderAttachable
51 {
52  public:
58 
59  private:
60  LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(LoggerPrivate, m_priv)
61  int m_threshold;
62 
63  public:
70  Logger(const LogString& name);
71 #if LOG4CXX_ABI_VERSION <= 15
72  [[ deprecated( "Pool is no longer required" ) ]]
73  Logger(helpers::Pool& pool, const LogString& name);
74 #endif
76 
77 
85  void addAppender(const AppenderPtr newAppender) override;
86 
87 
100  void callAppenders(const spi::LoggingEventPtr& event, 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
138 
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
171 
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
204 
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
269 
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
302 
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
335 
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
400 
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
433 
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
466 
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 
515  void addFatalEvent(std::string&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
516 
523  void addErrorEvent(std::string&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
524 
531  void addWarnEvent(std::string&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
532 
539  void addInfoEvent(std::string&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
540 
547  void addDebugEvent(std::string&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
548 
555  void addTraceEvent(std::string&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
556 
564  void forcedLog(const LevelPtr& level, const std::string& message,
565  const LOG4CXX_NS::spi::LocationInfo& location) const;
572  void forcedLog(const LevelPtr& level, const std::string& message) const;
573 
574 #if LOG4CXX_WCHAR_T_API
575 
582  void addEvent(const LevelPtr& level, std::wstring&& message
583  , const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
584 
591  void addFatalEvent(std::wstring&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
592 
599  void addErrorEvent(std::wstring&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
600 
607  void addWarnEvent(std::wstring&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
608 
615  void addInfoEvent(std::wstring&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
616 
623  void addDebugEvent(std::wstring&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
624 
631  void addTraceEvent(std::wstring&& message, const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
632 
640  void forcedLog(const LevelPtr& level, const std::wstring& message,
641  const LOG4CXX_NS::spi::LocationInfo& location) const;
648  void forcedLog(const LevelPtr& level, const std::wstring& message) const;
649 #endif
650 #if LOG4CXX_UNICHAR_API
651 
658  void addEvent(const LevelPtr& level, std::basic_string<UniChar>&& message,
659  const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
666  void addFatalEvent(std::basic_string<UniChar>&& message,const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
673  void addErrorEvent(std::basic_string<UniChar>&& message,const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
680  void addWarnEvent(std::basic_string<UniChar>&& message,const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
687  void addInfoEvent(std::basic_string<UniChar>&& message,const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
694  void addDebugEvent(std::basic_string<UniChar>&& message,const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
701  void addTraceEvent(std::basic_string<UniChar>&& message,const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
702 
710  void forcedLog(const LevelPtr& level, const std::basic_string<UniChar>& message,
711  const LOG4CXX_NS::spi::LocationInfo& location) const;
718  void forcedLog(const LevelPtr& level, const std::basic_string<UniChar>& message) const;
719 #endif
720 #if LOG4CXX_CFSTRING_API
721 
728  void forcedLog(const LevelPtr& level, const CFStringRef& message,
729  const LOG4CXX_NS::spi::LocationInfo& location) const;
736  void forcedLog(const LevelPtr& level, const CFStringRef& message) const;
737 #endif
738 
745  void addEventLS(const LevelPtr& level, LogString&& message
746  , const spi::LocationInfo& location = spi::LocationInfo::getLocationUnavailable()) const;
747 
755  void forcedLogLS(const LevelPtr& level, const LogString& message,
756  const LOG4CXX_NS::spi::LocationInfo& location) const;
757 
761  bool getAdditivity() const;
762 
768  AppenderList getAllAppenders() const override;
769 
774  AppenderPtr getAppender(const LogString& name) const override;
775 
785  virtual const LevelPtr& getEffectiveLevel() const;
786 
792 
797  const LogString& getName() const;
798 
803  void getName(std::string& name) const;
804 #if LOG4CXX_WCHAR_T_API
805 
809  void getName(std::wstring& name) const;
810 #endif
811 #if LOG4CXX_UNICHAR_API
812 
816  void getName(std::basic_string<UniChar>& name) const;
817 #endif
818 #if LOG4CXX_CFSTRING_API
819 
823  void getName(CFStringRef& name) const;
824 #endif
825 
833 
834 
840  const LevelPtr& getLevel() const;
841 
846  static LoggerPtr getLogger(const std::string& name);
851  static LoggerPtr getLogger(const char* const name);
852 #if LOG4CXX_WCHAR_T_API
853 
857  static LoggerPtr getLogger(const std::wstring& name);
862  static LoggerPtr getLogger(const wchar_t* const name);
863 #endif
864 #if LOG4CXX_UNICHAR_API
865 
869  static LoggerPtr getLogger(const std::basic_string<UniChar>& name);
870 #endif
871 #if LOG4CXX_CFSTRING_API
872 
876  static LoggerPtr getLogger(const CFStringRef& name);
877 #endif
878 
882  static LoggerPtr getLoggerLS(const LogString& name);
883 
888 
902  static LoggerPtr getLoggerLS(const LogString& name,
903  const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
917  static LoggerPtr getLogger(const std::string& name,
918  const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
919 #if LOG4CXX_WCHAR_T_API
920 
933  static LoggerPtr getLogger(const std::wstring& name,
934  const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
935 #endif
936 #if LOG4CXX_UNICHAR_API
937 
950  static LoggerPtr getLogger(const std::basic_string<UniChar>& name,
951  const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
952 #endif
953 #if LOG4CXX_CFSTRING_API
954 
967  static LoggerPtr getLogger(const CFStringRef& name,
968  const LOG4CXX_NS::spi::LoggerFactoryPtr& factory);
969 #endif
970 
980  helpers::ResourceBundlePtr getResourceBundle() const;
981 
982  protected:
993 
994  public:
1010  void info(const std::string& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1025  void info(const std::string& msg) const;
1026 #if LOG4CXX_WCHAR_T_API
1027 
1042  void info(const std::wstring& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1057  void info(const std::wstring& msg) const;
1058 #endif
1059 #if LOG4CXX_UNICHAR_API
1060 
1073  void info(const std::basic_string<UniChar>& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1088  void info(const std::basic_string<UniChar>& msg) const;
1089 #endif
1090 #if LOG4CXX_CFSTRING_API
1091 
1106  void info(const CFStringRef& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1121  void info(const CFStringRef& msg) const;
1122 #endif
1123 
1127  bool isAttached(const AppenderPtr appender) const override;
1128 
1163  bool isDebugEnabled() const;
1164 
1186  inline static bool isDebugEnabledFor(const LoggerPtr& logger)
1187  {
1188  return logger && logger->m_threshold <= Level::DEBUG_INT && logger->isDebugEnabled();
1189  }
1190 
1196  bool isEnabledFor(const LevelPtr& level) const;
1197 
1198 
1208  bool isInfoEnabled() const;
1209 
1220  inline static bool isInfoEnabledFor(const LoggerPtr& logger)
1221  {
1222  return logger && logger->m_threshold <= Level::INFO_INT && logger->isInfoEnabled();
1223  }
1224 
1234  bool isWarnEnabled() const;
1235 
1246  inline static bool isWarnEnabledFor(const LoggerPtr& logger)
1247  {
1248  return logger && logger->m_threshold <= Level::WARN_INT && logger->isWarnEnabled();
1249  }
1250 
1260  bool isErrorEnabled() const;
1261 
1272  inline static bool isErrorEnabledFor(const LoggerPtr& logger)
1273  {
1274  return logger && logger->m_threshold <= Level::ERROR_INT && logger->isErrorEnabled();
1275  }
1276 
1286  bool isFatalEnabled() const;
1287 
1298  inline static bool isFatalEnabledFor(const LoggerPtr& logger)
1299  {
1300  return logger && logger->m_threshold <= Level::FATAL_INT && logger->isFatalEnabled();
1301  }
1302 
1312  bool isTraceEnabled() const;
1313 
1324  inline static bool isTraceEnabledFor(const LoggerPtr& logger)
1325  {
1326  return logger && logger->m_threshold <= Level::TRACE_INT && logger->isTraceEnabled();
1327  }
1328 
1347  void l7dlog(const LevelPtr& level, const LogString& key,
1348  const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1349  const std::vector<LogString>& values) const;
1365  void l7dlog(const LevelPtr& level, const std::string& key,
1366  const LOG4CXX_NS::spi::LocationInfo& locationInfo) const;
1384  void l7dlog(const LevelPtr& level, const std::string& key,
1385  const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1386  const std::string& val) const;
1405  void l7dlog(const LevelPtr& level, const std::string& key,
1406  const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1407  const std::string& val1, const std::string& val2) const;
1427  void l7dlog(const LevelPtr& level, const std::string& key,
1428  const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1429  const std::string& val1, const std::string& val2, const std::string& val3) const;
1430 
1431 #if LOG4CXX_WCHAR_T_API
1432 
1447  void l7dlog(const LevelPtr& level, const std::wstring& key,
1448  const LOG4CXX_NS::spi::LocationInfo& locationInfo) const;
1466  void l7dlog(const LevelPtr& level, const std::wstring& key,
1467  const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1468  const std::wstring& val) const;
1487  void l7dlog(const LevelPtr& level, const std::wstring& key,
1488  const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1489  const std::wstring& val1, const std::wstring& val2) const;
1509  void l7dlog(const LevelPtr& level, const std::wstring& key,
1510  const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1511  const std::wstring& val1, const std::wstring& val2, const std::wstring& val3) const;
1512 #endif
1513 #if LOG4CXX_UNICHAR_API
1514 
1529  void l7dlog(const LevelPtr& level, const std::basic_string<UniChar>& key,
1530  const LOG4CXX_NS::spi::LocationInfo& locationInfo) const;
1548  void l7dlog(const LevelPtr& level, const std::basic_string<UniChar>& key,
1549  const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1550  const std::basic_string<UniChar>& val) const;
1569  void l7dlog(const LevelPtr& level, const std::basic_string<UniChar>& key,
1570  const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1571  const std::basic_string<UniChar>& val1, const std::basic_string<UniChar>& val2) const;
1591  void l7dlog(const LevelPtr& level, const std::basic_string<UniChar>& key,
1592  const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1593  const std::basic_string<UniChar>& val1, const std::basic_string<UniChar>& val2,
1594  const std::basic_string<UniChar>& val3) const;
1595 #endif
1596 #if LOG4CXX_CFSTRING_API
1597 
1612  void l7dlog(const LevelPtr& level, const CFStringRef& key,
1613  const LOG4CXX_NS::spi::LocationInfo& locationInfo) const;
1631  void l7dlog(const LevelPtr& level, const CFStringRef& key,
1632  const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1633  const CFStringRef& val1) const;
1652  void l7dlog(const LevelPtr& level, const CFStringRef& key,
1653  const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1654  const CFStringRef& val1, const CFStringRef& val2) const;
1674  void l7dlog(const LevelPtr& level, const CFStringRef& key,
1675  const LOG4CXX_NS::spi::LocationInfo& locationInfo,
1676  const CFStringRef& val1, const CFStringRef& val2,
1677  const CFStringRef& val3) const;
1678 #endif
1679 
1688  void log(const LevelPtr& level, const std::string& message,
1689  const LOG4CXX_NS::spi::LocationInfo& location) const;
1698  void log(const LevelPtr& level, const std::string& message) const;
1699 #if LOG4CXX_WCHAR_T_API
1700 
1708  void log(const LevelPtr& level, const std::wstring& message,
1709  const LOG4CXX_NS::spi::LocationInfo& location) const;
1718  void log(const LevelPtr& level, const std::wstring& message) const;
1719 #endif
1720 #if LOG4CXX_UNICHAR_API
1721 
1729  void log(const LevelPtr& level, const std::basic_string<UniChar>& message,
1730  const LOG4CXX_NS::spi::LocationInfo& location) const;
1739  void log(const LevelPtr& level, const std::basic_string<UniChar>& message) const;
1740 #endif
1741 #if LOG4CXX_CFSTRING_API
1742 
1750  void log(const LevelPtr& level, const CFStringRef& message,
1751  const LOG4CXX_NS::spi::LocationInfo& location) const;
1760  void log(const LevelPtr& level, const CFStringRef& message) const;
1761 #endif
1762 
1770  void logLS(const LevelPtr& level, const LogString& message,
1771  const LOG4CXX_NS::spi::LocationInfo& location) const;
1772 
1773 
1774 
1780  void removeAllAppenders() override;
1781 
1785  void removeAppender(const AppenderPtr appender) override;
1786 
1791  void removeAppender(const LogString& name) override;
1792 
1797  bool replaceAppender(const AppenderPtr& oldAppender, const AppenderPtr& newAppender) LOG4CXX_16_VIRTUAL_SPECIFIER;
1798 
1802  void replaceAppenders(const AppenderList& newList) LOG4CXX_16_VIRTUAL_SPECIFIER;
1803 
1807  void setAdditivity(bool additive);
1808 
1809  protected:
1810  friend class Hierarchy;
1822  void setParent(LoggerPtr parentLogger);
1827 
1828  private:
1829  spi::LoggerRepository* getHierarchy() const;
1830 
1831  public:
1838  virtual void setLevel(const LevelPtr level);
1839 
1843  void setResourceBundle(const helpers::ResourceBundlePtr& bundle);
1844 
1845 #if LOG4CXX_WCHAR_T_API
1846 
1861  void warn(const std::wstring& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1876  void warn(const std::wstring& msg) const;
1877 #endif
1878 #if LOG4CXX_UNICHAR_API
1879 
1894  void warn(const std::basic_string<UniChar>& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1909  void warn(const std::basic_string<UniChar>& msg) const;
1910 #endif
1911 #if LOG4CXX_CFSTRING_API
1912 
1927  void warn(const CFStringRef& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1942  void warn(const CFStringRef& msg) const;
1943 #endif
1944 
1959  void warn(const std::string& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
1974  void warn(const std::string& msg) const;
1975 
1976 #if LOG4CXX_WCHAR_T_API
1977 
1992  void trace(const std::wstring& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
2007  void trace(const std::wstring& msg) const;
2008 #endif
2009 #if LOG4CXX_UNICHAR_API
2010 
2025  void trace(const std::basic_string<UniChar>& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
2040  void trace(const std::basic_string<UniChar>& msg) const;
2041 #endif
2042 #if LOG4CXX_CFSTRING_API
2043 
2058  void trace(const CFStringRef& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
2073  void trace(const CFStringRef& msg) const;
2074 #endif
2075 
2090  void trace(const std::string& msg, const LOG4CXX_NS::spi::LocationInfo& location) const;
2105  void trace(const std::string& msg) const;
2106 
2114  void reconfigure( const AppenderList& newList, bool newAdditivity );
2115 
2116  private:
2117  //
2118  // prevent copy and assignment
2119  Logger(const Logger&);
2120  Logger& operator=(const Logger&);
2121 };
2123 }
2124 
2125 #if !defined(LOG4CXX_UNLIKELY)
2126  #if __GNUC__ >= 3
2127 
2133  #define LOG4CXX_UNLIKELY(expr) __builtin_expect(expr, 0)
2134  #else
2135 
2141  #define LOG4CXX_UNLIKELY(expr) expr
2142  #endif
2143 #endif
2144 
2145 #if defined(LOG4CXX_ENABLE_STACKTRACE) && !defined(LOG4CXX_STACKTRACE)
2146  #ifndef __has_include
2147  #include <boost/stacktrace.hpp>
2148  #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + boost::stacktrace::to_string(boost::stacktrace::stacktrace()));
2149  #elif __has_include(<stacktrace>)
2150  #include <stacktrace>
2151  #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + std::stacktrace::to_string(std::stacktrace::stacktrace()));
2152  #elif __has_include(<boost/stacktrace.hpp>)
2153  #include <boost/stacktrace.hpp>
2154  #define LOG4CXX_STACKTRACE ::LOG4CXX_NS::MDC mdc_("stacktrace", LOG4CXX_EOL + boost::stacktrace::to_string(boost::stacktrace::stacktrace()));
2155  #else
2156  #warning "Stacktrace requested but no implementation found"
2157  #endif
2158 #endif /* LOG4CXX_ENABLE_STACKTRACE */
2159 
2160 #if !defined(LOG4CXX_STACKTRACE)
2161 #define LOG4CXX_STACKTRACE
2162 #endif
2163 
2164 #ifndef LOG4CXX_FMT_VA_ARG
2165 #if __cplusplus >= 202002L
2166  #define LOG4CXX_FMT_VA_ARG(...) __VA_OPT__(,) __VA_ARGS__
2167 #else
2168  #define LOG4CXX_FMT_VA_ARG(...) , __VA_ARGS__
2169 #endif
2170 #endif
2171 
2183 #define LOG4CXX_LOG(logger, level, message) do { \
2184  if (logger->isEnabledFor(level)) {\
2185  ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2186  logger->addEvent(level, oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2187 
2196 #define LOG4CXX_LOG_FMT(logger, level, fmt, ...) do { \
2197  if (logger->isEnabledFor(level)) {\
2198  logger->addEvent(level, ::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__) ), LOG4CXX_LOCATION); }} while (0)
2199 
2207 #define LOG4CXX_LOGLS(logger, level, message) do { \
2208  if (logger->isEnabledFor(level)) {\
2209  ::LOG4CXX_NS::helpers::LogCharMessageBuffer oss_; \
2210  logger->addEvent(level, oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2211 
2212 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 10000
2213 
2232 #define LOG4CXX_DEBUG(logger, message) do { \
2233  if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isDebugEnabledFor(logger))) {\
2234  ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2235  logger->addDebugEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2236 
2256 #define LOG4CXX_DEBUG_FMT(logger, fmt, ...) do { \
2257  if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isDebugEnabledFor(logger))) {\
2258  logger->addDebugEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__) ), LOG4CXX_LOCATION); }} while (0)
2259 #else
2260 #define LOG4CXX_DEBUG(logger, message)
2261 #define LOG4CXX_DEBUG_FMT(logger, fmt, ...)
2262 #endif
2263 
2264 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 5000
2265 
2276 #define LOG4CXX_TRACE(logger, message) do { \
2277  if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isTraceEnabledFor(logger))) {\
2278  ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2279  logger->addTraceEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2280 
2293 #define LOG4CXX_TRACE_FMT(logger, fmt, ...) do { \
2294  if (LOG4CXX_UNLIKELY(::LOG4CXX_NS::Logger::isTraceEnabledFor(logger))) {\
2295  logger->addTraceEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2296 #else
2297 #define LOG4CXX_TRACE(logger, message)
2298 #define LOG4CXX_TRACE_FMT(logger, fmt, ...)
2299 #endif
2300 
2301 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 20000
2302 
2318 #define LOG4CXX_INFO(logger, message) do { \
2319  if (::LOG4CXX_NS::Logger::isInfoEnabledFor(logger)) {\
2320  ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2321  logger->addInfoEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2322 
2339 #define LOG4CXX_INFO_FMT(logger, fmt, ...) do { \
2340  if (::LOG4CXX_NS::Logger::isInfoEnabledFor(logger)) {\
2341  logger->addInfoEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2342 #else
2343 #define LOG4CXX_INFO(logger, message)
2344 #define LOG4CXX_INFO_FMT(logger, fmt, ...)
2345 #endif
2346 
2347 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 30000
2348 
2362 #define LOG4CXX_WARN(logger, message) do { \
2363  if (::LOG4CXX_NS::Logger::isWarnEnabledFor(logger)) {\
2364  ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2365  logger->addWarnEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2366 
2382 #define LOG4CXX_WARN_FMT(logger, fmt, ...) do { \
2383  if (::LOG4CXX_NS::Logger::isWarnEnabledFor(logger)) {\
2384  logger->addWarnEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2385 #else
2386 #define LOG4CXX_WARN(logger, message)
2387 #define LOG4CXX_WARN_FMT(logger, fmt, ...)
2388 #endif
2389 
2390 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 40000
2391 
2405 #define LOG4CXX_ERROR(logger, message) do { \
2406  if (::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2407  ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2408  logger->addErrorEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2409 
2425 #define LOG4CXX_ERROR_FMT(logger, fmt, ...) do { \
2426  if (::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2427  logger->addErrorEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2428 
2436 #define LOG4CXX_ASSERT(logger, condition, message) do { \
2437  if (!(condition) && ::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2438  ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2439  LOG4CXX_STACKTRACE \
2440  logger->addErrorEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2441 
2452 #define LOG4CXX_ASSERT_FMT(logger, condition, fmt, ...) do { \
2453  if (!(condition) && ::LOG4CXX_NS::Logger::isErrorEnabledFor(logger)) {\
2454  LOG4CXX_STACKTRACE \
2455  logger->addErrorEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2456 
2457 #else
2458 #define LOG4CXX_ERROR(logger, message)
2459 #define LOG4CXX_ERROR_FMT(logger, fmt, ...)
2460 #define LOG4CXX_ASSERT(logger, condition, message)
2461 #define LOG4CXX_ASSERT_FMT(logger, condition, fmt, ...)
2462 #endif
2463 
2464 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 50000
2465 
2476 #define LOG4CXX_FATAL(logger, message) do { \
2477  if (::LOG4CXX_NS::Logger::isFatalEnabledFor(logger)) {\
2478  ::LOG4CXX_NS::helpers::MessageBuffer oss_; \
2479  logger->addFatalEvent(oss_.extract_str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
2480 
2493 #define LOG4CXX_FATAL_FMT(logger, fmt, ...) do { \
2494  if (::LOG4CXX_NS::Logger::isFatalEnabledFor(logger)) {\
2495  logger->addFatalEvent(::LOG4CXX_FORMAT_NS::format(fmt LOG4CXX_FMT_VA_ARG(__VA_ARGS__)), LOG4CXX_LOCATION); }} while (0)
2496 #else
2497 #define LOG4CXX_FATAL(logger, message)
2498 #define LOG4CXX_FATAL_FMT(logger, fmt, ...)
2499 #endif
2500 
2508 #define LOG4CXX_L7DLOG(logger, level, key) do { \
2509  if (logger->isEnabledFor(level)) {\
2510  logger->l7dlog(level, key, LOG4CXX_LOCATION); }} while (0)
2511 
2520 #define LOG4CXX_L7DLOG1(logger, level, key, p1) do { \
2521  if (logger->isEnabledFor(level)) {\
2522  logger->l7dlog(level, key, LOG4CXX_LOCATION, p1); }} while (0)
2523 
2533 #define LOG4CXX_L7DLOG2(logger, level, key, p1, p2) do { \
2534  if (logger->isEnabledFor(level)) {\
2535  logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2); }} while (0)
2536 
2547 #define LOG4CXX_L7DLOG3(logger, level, key, p1, p2, p3) do { \
2548  if (logger->isEnabledFor(level)) {\
2549  logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2, p3); }} while (0)
2550 
2554 
2555 #endif //_LOG4CXX_LOGGER_H
log4cxx::Logger::replaceAppenders
void replaceAppenders(const AppenderList &newList) LOG4CXX_16_VIRTUAL_SPECIFIER
Replace all previously added appenders with newList.
log4cxx::Logger::addInfoEvent
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...
log4cxx::Logger::trace
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...
log4cxx::Logger::debug
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...
log4cxx::Logger::getLogger
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...
log4cxx::Logger::isAttached
bool isAttached(const AppenderPtr appender) const override
Is appender attached to this logger?
log4cxx::Logger::fatal
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...
log4cxx::Logger::l7dlog
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,...
log4cxx::LogString
std::basic_string< logchar > LogString
Definition: logstring.h:60
log4cxx::Logger::debug
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...
log4cxx::Logger::addErrorEvent
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...
log4cxx::Logger::error
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...
log4cxx::Logger::fatal
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...
log4cxx::Logger::isFatalEnabledFor
static bool isFatalEnabledFor(const LoggerPtr &logger)
Is logger is enabled for FATAL level logging events?
Definition: log4cxx/logger.h:1298
log4cxx::Logger::getName
const LogString & getName() const
Get the logger name.
log4cxx::Logger::warn
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...
log4cxx::Logger::log
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...
log4cxx::Logger::log
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...
log4cxx::spi::LoggerFactory
Implement this interface to create new instances of Logger or a sub-class of Logger.
Definition: loggerfactory.h:33
log4cxx::Logger::isTraceEnabledFor
static bool isTraceEnabledFor(const LoggerPtr &logger)
Is logger is enabled for TRACE level logging events?
Definition: log4cxx/logger.h:1324
log4cxx::Logger::getEffectiveLevel
virtual const LevelPtr & getEffectiveLevel() const
Starting from this logger, search the logger hierarchy for a non-null level and return it.
log4cxx::Logger::info
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...
log4cxx::Logger::log
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...
log4cxx::Logger::l7dlog
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...
log4cxx::Logger::warn
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...
log4cxx::Logger::fatal
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...
log4cxx::Logger::forcedLog
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...
BEGIN_LOG4CXX_CAST_MAP
#define BEGIN_LOG4CXX_CAST_MAP()
Definition: object.h:146
log4cxx::Logger::addTraceEvent
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...
log4cxx::Logger::getAdditivity
bool getAdditivity() const
Get the additivity flag for this logger.
log4cxx::Logger::warn
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...
log4cxx::Logger::getLogger
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...
log4cxx::Logger::debug
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...
log4cxx::Logger::isWarnEnabled
bool isWarnEnabled() const
Is this logger is enabled for WARN level logging events?
log4cxx::Logger::getLogger
static LoggerPtr getLogger(const wchar_t *const name)
Retrieve a logger by name.
log4cxx::Logger::error
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...
log4cxx::Logger::warn
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...
log4cxx::Logger::addErrorEvent
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...
log4cxx::Logger::warn
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...
log4cxx::Logger::reconfigure
void reconfigure(const AppenderList &newList, bool newAdditivity)
Replace all current appenders with newList and set the additivity flag to newAdditivity.
log4cxx::Logger::warn
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...
log4cxx::Logger::info
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...
log4cxx::Logger::fatal
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...
log4cxx::Logger::addTraceEvent
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...
log4cxx::Logger::getLevel
const LevelPtr & getLevel() const
The assigned Level, if any, for this logger.
log4cxx::Logger::isFatalEnabled
bool isFatalEnabled() const
Is this logger is enabled for FATAL level logging events?
log4cxx::Logger::getName
void getName(std::basic_string< UniChar > &name) const
Put name of this logger into name.
log4cxx::Logger::error
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...
log4cxx::Logger::isInfoEnabledFor
static bool isInfoEnabledFor(const LoggerPtr &logger)
Is logger is enabled for INFO level logging events?
Definition: log4cxx/logger.h:1220
log4cxx::Logger::getLogger
static LoggerPtr getLogger(const std::string &name)
Retrieve a logger by name in current encoding.
END_LOG4CXX_CAST_MAP
#define END_LOG4CXX_CAST_MAP()
Definition: object.h:152
log4cxx::Logger::getLogger
static LoggerPtr getLogger(const CFStringRef &name)
Retrieve a logger by name.
log4cxx::Logger::trace
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...
CFStringRef
const struct __CFString * CFStringRef
Definition: logstring.h:30
log4cxx::Logger::log
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...
log4cxx::Logger::addDebugEvent
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...
log4cxx::Logger::debug
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...
log4cxx::spi::AppenderAttachable
This Interface is for attaching Appenders to objects.
Definition: appenderattachable.h:33
log4cxx::Logger::warn
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...
log4cxx::Logger::l7dlog
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)...
log4cxx::Logger::debug
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...
log4cxx::Logger::addEventLS
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...
log4cxx::Logger::getLogger
static LoggerPtr getLogger(const std::wstring &name)
Retrieve a logger by name.
log4cxx::LevelPtr
std::shared_ptr< Level > LevelPtr
Definition: optionconverter.h:27
log4cxx::Logger::getAllAppenders
AppenderList getAllAppenders() const override
Get the appenders contained in this logger as an AppenderList.
log4cxx::Logger::addWarnEvent
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...
log4cxx::Hierarchy
This class is specialized in retrieving loggers by name and also maintaining the logger hierarchy.
Definition: hierarchy.h:52
log4cxx::Logger::getAppender
AppenderPtr getAppender(const LogString &name) const override
Look for the appender named as name.
log4cxx::Logger::log
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...
log4cxx::Logger::debug
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...
log4cxx::Logger::isDebugEnabled
bool isDebugEnabled() const
Is this logger is enabled for DEBUG level logging events?
log4cxx::Logger::fatal
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...
log4cxx::Logger::trace
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...
log4cxx::Logger::l7dlog
void l7dlog(const LevelPtr &level, const std::basic_string< UniChar > &key, const log4cxx::spi::LocationInfo &locationInfo, const std::basic_string< UniChar > &val1, const std::basic_string< UniChar > &val2, const std::basic_string< UniChar > &val3) const
Add a new logging event containing locationInfo and the localized message key using parameters val1,...
log4cxx::LOG4CXX_PTR_DEF
LOG4CXX_PTR_DEF(Logger)
smart pointer to a Logger class
log4cxx::Logger::trace
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::Logger::getName
void getName(std::string &name) const
Put name of this logger into name in current encoding.
log4cxx::Logger::addEvent
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...
log4cxx::Logger::getLoggerLS
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...
log4cxx::Logger::debug
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...
log4cxx::LoggerList
std::vector< LoggerPtr > LoggerList
Definition: logmanager.h:29
log4cxx::Logger::fatal
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...
log4cxx::Logger::getLoggerLS
static LoggerPtr getLoggerLS(const LogString &name)
Retrieve a logger by name in Unicode.
LOG4CXX_16_VIRTUAL_SPECIFIER
#define LOG4CXX_16_VIRTUAL_SPECIFIER
Definition: appenderattachable.h:99
log4cxx::Logger::forcedLog
void forcedLog(const LevelPtr &level, const CFStringRef &message) const
Add a new logging event containing message to attached appender(s) without further checks.
log4cxx::spi::LoggerRepository
A LoggerRepository is used to create and retrieve Loggers.
Definition: loggerrepository.h:43
log4cxx::Logger::isTraceEnabled
bool isTraceEnabled() const
Is this logger is enabled for TRACE level logging events?
log4cxx::Logger::l7dlog
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...
level.h
log4cxx::Logger::Logger
Logger(const LogString &name)
This constructor initializes a new logger instance and sets its name.
log4cxx::AppenderPtr
std::shared_ptr< Appender > AppenderPtr
Definition: basicconfigurator.h:28
log4cxx::Logger::addWarnEvent
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...
log4cxx::Logger::l7dlog
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)...
log4cxx::spi::LoggingEventPtr
std::shared_ptr< LoggingEvent > LoggingEventPtr
Definition: appender.h:31
log4cxx::Logger::l7dlog
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 ...
log4cxx::Logger::trace
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...
log4cxx::Logger::error
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...
log4cxx::Logger::l7dlog
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...
log4cxx::Logger::getName
void getName(std::wstring &name) const
Put name of this logger into name.
log4cxx::Logger::error
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...
log4cxx::Logger::isErrorEnabledFor
static bool isErrorEnabledFor(const LoggerPtr &logger)
Is logger is enabled for ERROR level logging events?
Definition: log4cxx/logger.h:1272
log4cxx::Logger::Logger
Logger(helpers::Pool &pool, const LogString &name)
log4cxx::Logger::getLogger
static LoggerPtr getLogger(const char *const name)
Retrieve a logger by name in current encoding.
pool.h
log4cxx::Logger::forcedLogLS
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...
log4cxx::Logger::getParent
LoggerPtr getParent() const
The parent of this logger.
log4cxx::Logger::forcedLog
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...
log4cxx::Logger::trace
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...
log4cxx::Logger::getRootLogger
static LoggerPtr getRootLogger()
Retrieve the root logger.
log4cxx::Logger::removeAppender
void removeAppender(const LogString &name) override
Remove the appender with the name passed as parameter form the list of appenders.
log4cxx::Logger::l7dlog
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)...
log4cxx::Logger::callAppenders
void callAppenders(const spi::LoggingEventPtr &event, helpers::Pool &p) const
Call the appenders in the hierrachy starting at this.
log4cxx::Logger::removeHierarchy
void removeHierarchy()
Only the Hierarchy class can remove the hierarchy of a logger.
log4cxx::Logger::addFatalEvent
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...
log4cxx::spi::LocationInfo
This class represents the location of a logging statement.
Definition: locationinfo.h:40
log4cxx::Logger::getName
void getName(CFStringRef &name) const
Put name of this logger into name.
log4cxx::Logger::l7dlog
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,...
log4cxx::Logger::addWarnEvent
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...
log4cxx::Logger::log
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...
log4cxx::Logger::closeNestedAppenders
void closeNestedAppenders()
Close all attached appenders implementing the AppenderAttachable interface.
log4cxx::spi::LoggerFactoryPtr
std::shared_ptr< LoggerFactory > LoggerFactoryPtr
Definition: logmanager.h:33
appenderattachable.h
log4cxx::Logger::getLogger
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...
log4cxx::Logger::addTraceEvent
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...
log4cxx::Logger::removeAllAppenders
void removeAllAppenders() override
Remove all previously added appenders from this logger instance.
log4cxx::Logger::error
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...
log4cxx::Logger::l7dlog
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,...
DECLARE_ABSTRACT_LOG4CXX_OBJECT
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)
Definition: object.h:39
log4cxx::Logger::forcedLog
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...
log4cxx::Logger::log
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...
log4cxx::Logger::fatal
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...
log4cxx::Logger::setResourceBundle
void setResourceBundle(const helpers::ResourceBundlePtr &bundle)
Set the resource bundle to be used with localized logging methods.
log4cxx::Logger::l7dlog
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 ...
messagebuffer.h
log4cxx::Logger
This is the central class in the log4cxx package.
Definition: log4cxx/logger.h:51
log4cxx::Logger::warn
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...
log4cxx::Logger::removeAppender
void removeAppender(const AppenderPtr appender) override
Remove the appender passed as parameter form the list of appenders.
log4cxx::Logger::addErrorEvent
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...
log4cxx::Logger::info
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...
locationinfo.h
log4cxx::Logger::getLogger
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...
log4cxx::Logger::forcedLog
void forcedLog(const LevelPtr &level, const std::string &message) const
Add a new logging event containing message to attached appender(s) without further checks.
log4cxx::Logger::info
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...
log4cxx::Logger::addAppender
void addAppender(const AppenderPtr newAppender) override
Add newAppender to the list of appenders of this Logger instance.
log4cxx::Logger::error
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...
log4cxx::Logger::addEvent
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...
log4cxx::Logger::logLS
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...
log4cxx::Logger::~Logger
~Logger()
log4cxx::Logger::addDebugEvent
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...
log4cxx::Logger::fatal
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...
log4cxx::Logger::l7dlog
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...
log4cxx::Logger::isErrorEnabled
bool isErrorEnabled() const
Is this logger is enabled for ERROR level logging events?
log4cxx::Logger::forcedLog
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...
log4cxx::Logger::addInfoEvent
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...
log4cxx::Logger::isInfoEnabled
bool isInfoEnabled() const
Is this logger is enabled for INFO level logging events?
log4cxx::Logger::addEvent
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...
log4cxx::Logger::isEnabledFor
bool isEnabledFor(const LevelPtr &level) const
Is this logger is enabled for logging events at level?
log4cxx::Logger::setAdditivity
void setAdditivity(bool additive)
Set the additivity flag for this logger.
log4cxx::Logger::updateThreshold
void updateThreshold()
Only the Hierarchy class can change the threshold of a logger.
log4cxx::Logger::replaceAppender
bool replaceAppender(const AppenderPtr &oldAppender, const AppenderPtr &newAppender) LOG4CXX_16_VIRTUAL_SPECIFIER
Replace oldAppender with newAppender.
log4cxx::Logger::isWarnEnabledFor
static bool isWarnEnabledFor(const LoggerPtr &logger)
Is logger is enabled for WARN level logging events?
Definition: log4cxx/logger.h:1246
log4cxx::Logger::trace
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...
log4cxx::Logger::forcedLog
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.
log4cxx::Logger::info
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...
log4cxx::helpers::Pool
Definition: pool.h:33
log4cxx::Logger::isDebugEnabledFor
static bool isDebugEnabledFor(const LoggerPtr &logger)
Is logger is enabled for DEBUG level logging events?
Definition: log4cxx/logger.h:1186
log4cxx::LOG4CXX_LIST_DEF
LOG4CXX_LIST_DEF(LoggerList, LoggerPtr)
log4cxx::Logger::info
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...
resourcebundle.h
log4cxx::Logger::error
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...
log4cxx::Logger::forcedLog
void forcedLog(const LevelPtr &level, const std::wstring &message) const
Add a new logging event containing message to attached appender(s) without further checks.
log4cxx::Logger::l7dlog
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 ...
log4cxx::Logger::setLevel
virtual void setLevel(const LevelPtr level)
Set the level of this logger.
log4cxx::LoggerPtr
std::shared_ptr< Logger > LoggerPtr
Definition: defaultloggerfactory.h:26
log4cxx::Logger::l7dlog
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...
log4cxx::Logger::debug
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...
log4cxx::Logger::l7dlog
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)...
log4cxx::Logger::setParent
void setParent(LoggerPtr parentLogger)
Only the Hierarchy class can set the parent of a logger.
log4cxx::Logger::trace
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...
log4cxx::Logger::setHierarchy
void setHierarchy(spi::LoggerRepository *repository)
Only the Hierarchy class can set the hierarchy of a logger.
loggerrepository.h
log4cxx::Logger::getResourceBundle
helpers::ResourceBundlePtr getResourceBundle() const
Return the inherited ResourceBundle for this logger.
log4cxx::Logger::getLogger
static LoggerPtr getLogger(const std::basic_string< UniChar > &name)
Retrieve a logger by name.
log4cxx::Logger::addFatalEvent
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...
log4cxx::Logger::addFatalEvent
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...
log4cxx::Logger::info
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...
log4cxx::Logger::getLoggerRepository
spi::LoggerRepository * getLoggerRepository() const
Return the the LoggerRepository where this Logger is attached.
log4cxx::Logger::log
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...
log4cxx::Logger::addInfoEvent
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...
log4cxx::Logger::addDebugEvent
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...
LOG4CXX_CAST_ENTRY
#define LOG4CXX_CAST_ENTRY(Interface)
Definition: object.h:158
log4cxx::Logger::l7dlog
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 ...
log4cxx::Logger::info
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...
log4cxx::Logger::getResourceBundleString
LogString getResourceBundleString(const LogString &key) const
Returns the string resource corresponding to key in this logger's inherited resource bundle.