You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by sw...@apache.org on 2025/10/30 05:11:13 UTC
(logging-log4cxx) branch simplify_extension_support_macros created (now 96fadbe9)
This is an automated email from the ASF dual-hosted git repository.
swebb2066 pushed a change to branch simplify_extension_support_macros
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
at 96fadbe9 Improve consistancy and clarity in the macros enabling Log4cxx extensions
This branch includes the following new commits:
new 96fadbe9 Improve consistancy and clarity in the macros enabling Log4cxx extensions
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(logging-log4cxx) 01/01: Improve consistancy and clarity in the macros enabling Log4cxx extensions
Posted by sw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
swebb2066 pushed a commit to branch simplify_extension_support_macros
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
commit 96fadbe9daee29d84392a3ff0ef09e5da08220f8
Author: Stephen Webb <sw...@gmail.com>
AuthorDate: Thu Oct 30 16:10:55 2025 +1100
Improve consistancy and clarity in the macros enabling Log4cxx extensions
---
src/main/include/log4cxx/helpers/object.h | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/src/main/include/log4cxx/helpers/object.h b/src/main/include/log4cxx/helpers/object.h
index 6dc9f049..566d1eaa 100644
--- a/src/main/include/log4cxx/helpers/object.h
+++ b/src/main/include/log4cxx/helpers/object.h
@@ -26,15 +26,13 @@
#define DECLARE_LOG4CXX_CLAZZ_OBJECT(object)\
public:\
- class Clazz##object : public helpers::Class\
+ class Clazz##object : public LOG4CXX_NS::helpers::Class\
{\
public:\
- Clazz##object() : helpers::Class() {}\
- virtual ~Clazz##object() {}\
- virtual LOG4CXX_NS::LogString getName() const { return LOG4CXX_STR(#object); } \
+ LogString getName() const override { return LOG4CXX_STR(#object); }\
};\
- static const helpers::Class& getStaticClass(); \
- static const LOG4CXX_NS::helpers::ClassRegistration& registerClass();
+ static const helpers::Class& getStaticClass();\
+ static const helpers::ClassRegistration& registerClass();
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)\
DECLARE_LOG4CXX_CLAZZ_OBJECT(object)\
@@ -42,26 +40,24 @@
#define DECLARE_LOG4CXX_OBJECT(object)\
public:\
- class Clazz##object : public helpers::Class\
+ class Clazz##object : public LOG4CXX_NS::helpers::Class\
{\
public:\
- Clazz##object() : helpers::Class() {}\
- virtual ~Clazz##object() {}\
- virtual LOG4CXX_NS::LogString getName() const { return LOG4CXX_STR(#object); } \
- virtual object* newInstance() const\
+ LogString getName() const override { return LOG4CXX_STR(#object); }\
+ object* newInstance() const override\
{\
return new object();\
}\
};\
const helpers::Class& getClass() const override;\
static const helpers::Class& getStaticClass(); \
- static const LOG4CXX_NS::helpers::ClassRegistration& registerClass();
+ static const helpers::ClassRegistration& registerClass();
#define DECLARE_LOG4CXX_OBJECT_WITH_CUSTOM_CLASS(object, class)\
public:\
const helpers::Class& getClass() const override;\
static const helpers::Class& getStaticClass();\
- static const LOG4CXX_NS::helpers::ClassRegistration& registerClass();
+ static const helpers::ClassRegistration& registerClass();
#define IMPLEMENT_LOG4CXX_OBJECT(object)\
const ::LOG4CXX_NS::helpers::Class& object::getClass() const { return getStaticClass(); }\
@@ -74,7 +70,7 @@
return classReg; \
}\
namespace LOG4CXX_NS { namespace classes { \
- const ::LOG4CXX_NS::helpers::ClassRegistration& object##Registration = object::registerClass(); \
+ const helpers::ClassRegistration& object##Registration = object::registerClass(); \
} }
@@ -89,7 +85,7 @@
return classReg; \
}\
namespace LOG4CXX_NS { namespace classes { \
- const LOG4CXX_NS::helpers::ClassRegistration& object##Registration = object::registerClass(); \
+ const helpers::ClassRegistration& object##Registration = object::registerClass(); \
} }
namespace LOG4CXX_NS