diff --git a/src/main/cpp/logger.cpp b/src/main/cpp/logger.cpp index 9574a149f..935d8bdda 100644 --- a/src/main/cpp/logger.cpp +++ b/src/main/cpp/logger.cpp @@ -327,10 +327,17 @@ const LevelPtr& Logger::getEffectiveLevel() const #endif } +#if LOG4CXX_ABI_VERSION <= 15 LoggerRepository* Logger::getLoggerRepository() const { return m_priv->repositoryRaw; } +#else +LoggerRepositoryPtr Logger::getLoggerRepository() +{ + return LogManager::getLoggerRepository(); +} +#endif LoggerRepository* Logger::getHierarchy() const { diff --git a/src/main/include/log4cxx/logger.h b/src/main/include/log4cxx/logger.h index 1241d0c95..4078615da 100644 --- a/src/main/include/log4cxx/logger.h +++ b/src/main/include/log4cxx/logger.h @@ -843,11 +843,13 @@ class LOG4CXX_EXPORT Logger */ virtual const LevelPtr& getEffectiveLevel() const; +#if LOG4CXX_ABI_VERSION <= 15 /** Return the the LoggerRepository where this Logger is attached. */ spi::LoggerRepository* getLoggerRepository() const; +#endif /** * Get the logger name. @@ -898,6 +900,13 @@ class LOG4CXX_EXPORT Logger */ const LevelPtr& getLevel() const; +#if 15 < LOG4CXX_ABI_VERSION + /** + The object that holds all Logger instances. + */ + static spi::LoggerRepositoryPtr getLoggerRepository(); +#endif + /** * Retrieve a logger by name in current encoding. * @param name logger name.