This is an automated email from the ASF dual-hosted git repository. swebb2066 pushed a commit to branch make_logger_consistent in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
commit b31f3c73c0bd7cfc7e6e975407a4d0420fc795af Author: Stephen Webb <[email protected]> AuthorDate: Sat Nov 8 18:01:00 2025 +1100 Improve Logger interface consistency in the next ABI --- src/main/cpp/logger.cpp | 7 +++++++ src/main/include/log4cxx/logger.h | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/src/main/cpp/logger.cpp b/src/main/cpp/logger.cpp index 9574a149..935d8bdd 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 1241d0c9..4078615d 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 <code>Logger</code> 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.
