This is an automated email from the ASF dual-hosted git repository.

swebb2066 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git


The following commit(s) were added to refs/heads/master by this push:
     new 12fc6edf Improve Logger interface consistency in the next ABI (#562)
12fc6edf is described below

commit 12fc6edf3be71aedc7c929a7a682215338205ef8
Author: Stephen Webb <[email protected]>
AuthorDate: Mon Nov 10 15:04:03 2025 +1100

    Improve Logger interface consistency in the next ABI (#562)
---
 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.

Reply via email to