From 932663da33589b4c35ae3fa72e735869dbf6d243 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 12 Nov 2022 17:42:37 +1100 Subject: [PATCH 01/17] Prevent Clang warning messages --- src/main/include/log4cxx/helpers/object.h | 8 ++++---- src/main/include/log4cxx/hierarchy.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/include/log4cxx/helpers/object.h b/src/main/include/log4cxx/helpers/object.h index b8382a5cb..63532c3e6 100644 --- a/src/main/include/log4cxx/helpers/object.h +++ b/src/main/include/log4cxx/helpers/object.h @@ -49,13 +49,13 @@ return new object();\ }\ };\ - virtual const helpers::Class& getClass() const;\ + const helpers::Class& getClass() const override;\ static const helpers::Class& getStaticClass(); \ static const log4cxx::helpers::ClassRegistration& registerClass(); #define DECLARE_LOG4CXX_OBJECT_WITH_CUSTOM_CLASS(object, class)\ public:\ - virtual const helpers::Class& getClass() const;\ + const helpers::Class& getClass() const override;\ static const helpers::Class& getStaticClass();\ static const log4cxx::helpers::ClassRegistration& registerClass(); @@ -139,7 +139,7 @@ std::shared_ptr cast(const std::shared_ptr& incoming) } #define BEGIN_LOG4CXX_CAST_MAP()\ - const void * cast(const helpers::Class& clazz) const\ + const void * cast(const helpers::Class& clazz) const override\ {\ const void * object = 0;\ if (&clazz == &helpers::Object::getStaticClass()) return (const helpers::Object *)this; @@ -147,7 +147,7 @@ std::shared_ptr cast(const std::shared_ptr& incoming) #define END_LOG4CXX_CAST_MAP()\ return object;\ }\ - bool instanceof(const helpers::Class& clazz) const\ + bool instanceof(const helpers::Class& clazz) const override\ { return cast(clazz) != 0; } #define LOG4CXX_CAST_ENTRY(Interface)\ diff --git a/src/main/include/log4cxx/hierarchy.h b/src/main/include/log4cxx/hierarchy.h index e4d06fde3..bb3a692d3 100644 --- a/src/main/include/log4cxx/hierarchy.h +++ b/src/main/include/log4cxx/hierarchy.h @@ -100,7 +100,7 @@ class LOG4CXX_EXPORT Hierarchy : public spi::LoggerRepository @param name The name of the logger to search for. */ - LoggerPtr exists(const LogString& name); + LoggerPtr exists(const LogString& name) override; /** The string form of {@link #setThreshold(const LevelPtr&) setThreshold}. @@ -160,7 +160,7 @@ class LOG4CXX_EXPORT Hierarchy : public spi::LoggerRepository

The root logger is not included in the returned LoggerList. */ - LoggerList getCurrentLoggers() const; + LoggerList getCurrentLoggers() const override; /** Get the root of this hierarchy. From 4e03872033f0ee484e694a366fb0814e197817c6 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 12 Nov 2022 18:09:29 +1100 Subject: [PATCH 02/17] Prevent Clang warning messages --- src/main/include/log4cxx/helpers/object.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/include/log4cxx/helpers/object.h b/src/main/include/log4cxx/helpers/object.h index 63532c3e6..6e0fe24fe 100644 --- a/src/main/include/log4cxx/helpers/object.h +++ b/src/main/include/log4cxx/helpers/object.h @@ -23,7 +23,7 @@ #include -#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)\ +#define DECLARE_LOG4CXX_CLAZZ_OBJECT(object)\ public:\ class Clazz##object : public helpers::Class\ {\ @@ -32,10 +32,13 @@ virtual ~Clazz##object() {}\ virtual log4cxx::LogString getName() const { return LOG4CXX_STR(#object); } \ };\ - virtual const helpers::Class& getClass() const;\ static const helpers::Class& getStaticClass(); \ static const log4cxx::helpers::ClassRegistration& registerClass(); +#define DECLARE_ABSTRACT_LOG4CXX_OBJECT(object)\ + DECLARE_LOG4CXX_CLAZZ_OBJECT(object)\ + const helpers::Class& getClass() const override; + #define DECLARE_LOG4CXX_OBJECT(object)\ public:\ class Clazz##object : public helpers::Class\ @@ -101,10 +104,11 @@ class Pool; class LOG4CXX_EXPORT Object { public: - DECLARE_ABSTRACT_LOG4CXX_OBJECT(Object) virtual ~Object() {} + virtual const helpers::Class& getClass() const = 0; virtual bool instanceof(const Class& clazz) const = 0; virtual const void* cast(const Class& clazz) const = 0; + DECLARE_LOG4CXX_CLAZZ_OBJECT(Object) }; LOG4CXX_PTR_DEF(Object); } From dd1fc4a4b59db64b4f62cadf658d4b926b3c3d52 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 12 Nov 2022 18:19:09 +1100 Subject: [PATCH 03/17] Prevent compiler warning messages --- src/test/cpp/abts.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/cpp/abts.cpp b/src/test/cpp/abts.cpp index 5843d649e..1efb8344f 100644 --- a/src/test/cpp/abts.cpp +++ b/src/test/cpp/abts.cpp @@ -108,7 +108,7 @@ static void end_suite(abts_suite* suite) } else { - fprintf(stdout, "FAILED %d of %d\n", last->failed.size(), last->num_test); + fprintf(stdout, "FAILED %d of %d\n", (int)last->failed.size(), last->num_test); fflush(stdout); } } @@ -217,7 +217,7 @@ void abts_run_test(abts_suite* ts, const char* name, test_func f, void* value) static int report(abts_suite* suite) { - int count = 0; + size_t count = 0; sub_suite* dptr; if (suite && suite->tail && !suite->tail->not_run) @@ -251,7 +251,7 @@ static int report(abts_suite* suite) { float percent = ((float)dptr->failed.size() / (float)dptr->num_test); fprintf(stdout, "%-15s\t\t%5d\t%4d\t%6.2f%%\n", dptr->name, - dptr->num_test, dptr->failed.size(), percent * 100); + dptr->num_test, (int)dptr->failed.size(), percent * 100); for( const char* failed_name : dptr->failed ){ fprintf(stdout, " %s\n", failed_name ); } From b7f90aad227ef47c6b9f116fa9d6c31280f83d79 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 12 Nov 2022 18:28:26 +1100 Subject: [PATCH 04/17] Prevent Clang warning messages --- src/main/include/log4cxx/asyncappender.h | 12 ++++++------ .../log4cxx/helpers/appenderattachableimpl.h | 17 ++++++++--------- src/main/include/log4cxx/logger.h | 9 ++++----- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/main/include/log4cxx/asyncappender.h b/src/main/include/log4cxx/asyncappender.h index 9f4339bf1..74e358fc8 100644 --- a/src/main/include/log4cxx/asyncappender.h +++ b/src/main/include/log4cxx/asyncappender.h @@ -83,7 +83,7 @@ class LOG4CXX_EXPORT AsyncAppender : * * @param newAppender appender to add, may not be null. */ - void addAppender(const AppenderPtr newAppender); + void addAppender(const AppenderPtr newAppender) override; virtual void doAppend(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool1); @@ -101,7 +101,7 @@ class LOG4CXX_EXPORT AsyncAppender : * Get iterator over attached appenders. * @return list of all attached appenders. */ - AppenderList getAllAppenders() const; + AppenderList getAllAppenders() const override; /** * Get appender by name. @@ -123,25 +123,25 @@ class LOG4CXX_EXPORT AsyncAppender : * @param appender appender. * @return true if attached. */ - bool isAttached(const AppenderPtr appender) const; + bool isAttached(const AppenderPtr appender) const override; virtual bool requiresLayout() const; /** * Removes and closes all attached appenders. */ - void removeAllAppenders(); + void removeAllAppenders() override; /** * Removes an appender. * @param appender appender to remove. */ - void removeAppender(const AppenderPtr appender); + void removeAppender(const AppenderPtr appender) override; /** * Remove appender by name. * @param name name. */ - void removeAppender(const LogString& name); + void removeAppender(const LogString& name) override; /** * The LocationInfo attribute is provided for compatibility diff --git a/src/main/include/log4cxx/helpers/appenderattachableimpl.h b/src/main/include/log4cxx/helpers/appenderattachableimpl.h index 2317d3a90..40d502811 100644 --- a/src/main/include/log4cxx/helpers/appenderattachableimpl.h +++ b/src/main/include/log4cxx/helpers/appenderattachableimpl.h @@ -37,8 +37,7 @@ namespace helpers { class LOG4CXX_EXPORT AppenderAttachableImpl : - public virtual spi::AppenderAttachable, - public virtual helpers::Object + public virtual spi::AppenderAttachable { protected: AppenderList& appenderList(); @@ -62,7 +61,7 @@ class LOG4CXX_EXPORT AppenderAttachableImpl : /** * Add an appender. */ - virtual void addAppender(const AppenderPtr newAppender); + void addAppender(const AppenderPtr newAppender) override; /** Call the doAppend method on all attached appenders. @@ -73,34 +72,34 @@ class LOG4CXX_EXPORT AppenderAttachableImpl : /** * Get all previously added appenders as an Enumeration. */ - virtual AppenderList getAllAppenders() const; + AppenderList getAllAppenders() const override; /** * Get an appender by name. */ - virtual AppenderPtr getAppender(const LogString& name) const; + AppenderPtr getAppender(const LogString& name) const override; /** Returns true if the specified appender is in the list of attached appenders, false otherwise. */ - virtual bool isAttached(const AppenderPtr appender) const; + bool isAttached(const AppenderPtr appender) const override; /** * Remove all previously added appenders. */ - virtual void removeAllAppenders(); + void removeAllAppenders() override; /** * Remove the appender passed as parameter from the list of appenders. */ - virtual void removeAppender(const AppenderPtr appender); + void removeAppender(const AppenderPtr appender) override; /** * Remove the appender with the name passed as parameter from the * list of appenders. */ - virtual void removeAppender(const LogString& name); + void removeAppender(const LogString& name) override; private: LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(priv_data, m_priv) diff --git a/src/main/include/log4cxx/logger.h b/src/main/include/log4cxx/logger.h index d5b9c9a55..a3284ca5a 100644 --- a/src/main/include/log4cxx/logger.h +++ b/src/main/include/log4cxx/logger.h @@ -47,8 +47,7 @@ This is the central class in the log4cxx package. Most logging operations, except configuration, are done through this class. */ class LOG4CXX_EXPORT Logger : - public virtual log4cxx::spi::AppenderAttachable, - public virtual helpers::Object + public virtual log4cxx::spi::AppenderAttachable { public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(Logger) @@ -83,7 +82,7 @@ class LOG4CXX_EXPORT Logger :

If newAppender is already in the list of appenders, then it won't be added again. */ - virtual void addAppender(const AppenderPtr newAppender); + void addAppender(const AppenderPtr newAppender) override; /** @@ -542,13 +541,13 @@ class LOG4CXX_EXPORT Logger : If no appenders can be found, then an empty AppenderList is returned. @return AppenderList An collection of the appenders in this logger.*/ - AppenderList getAllAppenders() const; + AppenderList getAllAppenders() const override; /** Look for the appender named as name.

Return the appender with that name if in the list. Return NULL otherwise. */ - AppenderPtr getAppender(const LogString& name) const; + AppenderPtr getAppender(const LogString& name) const override; /** Starting from this logger, search the logger hierarchy for a From 5a5d08ae023a004839e9a3d74be39e405b03f4a0 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 12 Nov 2022 20:49:24 +1100 Subject: [PATCH 05/17] Prevent Clang warning messages --- src/main/include/log4cxx/logger.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/include/log4cxx/logger.h b/src/main/include/log4cxx/logger.h index a3284ca5a..27eb93d15 100644 --- a/src/main/include/log4cxx/logger.h +++ b/src/main/include/log4cxx/logger.h @@ -875,7 +875,7 @@ class LOG4CXX_EXPORT Logger : /** Is the appender passed as parameter attached to this logger? */ - bool isAttached(const AppenderPtr appender) const; + bool isAttached(const AppenderPtr appender) const override; /** * Check whether this logger is enabled for the DEBUG @@ -1405,18 +1405,18 @@ class LOG4CXX_EXPORT Logger : instance.

This is useful when re-reading configuration information. */ - void removeAllAppenders(); + void removeAllAppenders() override; /** Remove the appender passed as parameter form the list of appenders. */ - void removeAppender(const AppenderPtr appender); + void removeAppender(const AppenderPtr appender) override; /** Remove the appender with the name passed as parameter form the list of appenders. */ - void removeAppender(const LogString& name); + void removeAppender(const LogString& name) override; /** Set the additivity flag for this Logger instance. From 89bc2df3582ba05efc81ccef72fbc756fb301497 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sat, 12 Nov 2022 21:18:03 +1100 Subject: [PATCH 06/17] Prevent Clang warning messages --- src/main/include/log4cxx/appenderskeleton.h | 2 +- src/main/include/log4cxx/asyncappender.h | 2 +- src/main/include/log4cxx/consoleappender.h | 4 ++-- src/main/include/log4cxx/db/odbcappender.h | 4 ++-- src/main/include/log4cxx/fileappender.h | 5 ++--- src/main/include/log4cxx/filter/expressionfilter.h | 2 +- src/main/include/log4cxx/filter/levelmatchfilter.h | 3 +-- src/main/include/log4cxx/filter/levelrangefilter.h | 3 +-- src/main/include/log4cxx/filter/locationinfofilter.h | 2 +- src/main/include/log4cxx/filter/loggermatchfilter.h | 3 +-- src/main/include/log4cxx/filter/mapfilter.h | 3 +-- src/main/include/log4cxx/helpers/onlyonceerrorhandler.h | 4 ++-- src/main/include/log4cxx/htmllayout.h | 4 ++-- src/main/include/log4cxx/jsonlayout.h | 4 ++-- src/main/include/log4cxx/net/smtpappender.h | 4 ++-- src/main/include/log4cxx/net/socketappenderskeleton.h | 3 +-- src/main/include/log4cxx/net/sockethubappender.h | 4 ++-- src/main/include/log4cxx/net/syslogappender.h | 4 ++-- src/main/include/log4cxx/net/telnetappender.h | 4 ++-- src/main/include/log4cxx/nt/nteventlogappender.h | 4 ++-- src/main/include/log4cxx/patternlayout.h | 2 +- .../include/log4cxx/rolling/filterbasedtriggeringpolicy.h | 4 ++-- .../include/log4cxx/rolling/fixedwindowrollingpolicy.h | 5 ++--- src/main/include/log4cxx/rolling/manualtriggeringpolicy.h | 4 ++-- .../log4cxx/rolling/multiprocessrollingfileappender.h | 2 +- src/main/include/log4cxx/rolling/rollingfileappender.h | 2 +- .../include/log4cxx/rolling/sizebasedtriggeringpolicy.h | 4 ++-- src/main/include/log4cxx/rolling/timebasedrollingpolicy.h | 2 +- src/main/include/log4cxx/simplelayout.h | 4 ++-- src/main/include/log4cxx/spi/filter.h | 7 +++---- src/main/include/log4cxx/varia/fallbackerrorhandler.h | 2 +- src/main/include/log4cxx/writerappender.h | 5 ++--- src/main/include/log4cxx/xml/xmllayout.h | 2 +- 33 files changed, 52 insertions(+), 61 deletions(-) diff --git a/src/main/include/log4cxx/appenderskeleton.h b/src/main/include/log4cxx/appenderskeleton.h index c52110e8b..6550e4904 100644 --- a/src/main/include/log4cxx/appenderskeleton.h +++ b/src/main/include/log4cxx/appenderskeleton.h @@ -75,7 +75,7 @@ class LOG4CXX_EXPORT AppenderSkeleton : requires it. */ virtual void activateOptions(log4cxx::helpers::Pool& /* pool */) {} - virtual void setOption(const LogString& option, const LogString& value); + virtual void setOption(const LogString& option, const LogString& value) override; /** Add a filter to end of the filter list. diff --git a/src/main/include/log4cxx/asyncappender.h b/src/main/include/log4cxx/asyncappender.h index 74e358fc8..e6c75179d 100644 --- a/src/main/include/log4cxx/asyncappender.h +++ b/src/main/include/log4cxx/asyncappender.h @@ -186,7 +186,7 @@ class LOG4CXX_EXPORT AsyncAppender : * @param option property name. * @param value property value. */ - void setOption(const LogString& option, const LogString& value); + void setOption(const LogString& option, const LogString& value) override; private: diff --git a/src/main/include/log4cxx/consoleappender.h b/src/main/include/log4cxx/consoleappender.h index 49d93823c..f47bb95ff 100644 --- a/src/main/include/log4cxx/consoleappender.h +++ b/src/main/include/log4cxx/consoleappender.h @@ -66,8 +66,8 @@ class LOG4CXX_EXPORT ConsoleAppender : public WriterAppender * */ LogString getTarget() const; - void activateOptions(log4cxx::helpers::Pool& p); - void setOption(const LogString& option, const LogString& value); + void activateOptions(log4cxx::helpers::Pool& p) override; + void setOption(const LogString& option, const LogString& value) override; static const LogString& getSystemOut(); static const LogString& getSystemErr(); diff --git a/src/main/include/log4cxx/db/odbcappender.h b/src/main/include/log4cxx/db/odbcappender.h index aab2d4545..1939442d1 100644 --- a/src/main/include/log4cxx/db/odbcappender.h +++ b/src/main/include/log4cxx/db/odbcappender.h @@ -116,12 +116,12 @@ class LOG4CXX_EXPORT ODBCAppender : public AppenderSkeleton /** Set options */ - virtual void setOption(const LogString& option, const LogString& value); + virtual void setOption(const LogString& option, const LogString& value) override; /** Activate the specified options. */ - virtual void activateOptions(log4cxx::helpers::Pool& p); + void activateOptions(log4cxx::helpers::Pool& p) override; /** * Adds the event to the buffer. When full the buffer is flushed. diff --git a/src/main/include/log4cxx/fileappender.h b/src/main/include/log4cxx/fileappender.h index 51a585268..90489798d 100644 --- a/src/main/include/log4cxx/fileappender.h +++ b/src/main/include/log4cxx/fileappender.h @@ -117,9 +117,8 @@ class LOG4CXX_EXPORT FileAppender : public WriterAppender

If there was already an opened file, then the previous file is closed first.*/ - void activateOptions(log4cxx::helpers::Pool& p); - void setOption(const LogString& option, - const LogString& value); + void activateOptions(log4cxx::helpers::Pool& p) override; + void setOption(const LogString& option, const LogString& value) override; /** Get the value of the BufferedIO option. diff --git a/src/main/include/log4cxx/filter/expressionfilter.h b/src/main/include/log4cxx/filter/expressionfilter.h index 5b01b4a87..6ea751dfb 100644 --- a/src/main/include/log4cxx/filter/expressionfilter.h +++ b/src/main/include/log4cxx/filter/expressionfilter.h @@ -100,7 +100,7 @@ class LOG4CXX_EXPORT ExpressionFilter: public log4cxx::spi::Filter ExpressionFilter(); - void activateOptions(log4cxx::helpers::Pool& p); + void activateOptions(log4cxx::helpers::Pool& p) override; void setExpression(const LogString& expression); diff --git a/src/main/include/log4cxx/filter/levelmatchfilter.h b/src/main/include/log4cxx/filter/levelmatchfilter.h index 56aa50fb9..c775ac92a 100644 --- a/src/main/include/log4cxx/filter/levelmatchfilter.h +++ b/src/main/include/log4cxx/filter/levelmatchfilter.h @@ -65,8 +65,7 @@ class LOG4CXX_EXPORT LevelMatchFilter : public spi::Filter /** Set options */ - virtual void setOption(const LogString& option, - const LogString& value); + void setOption(const LogString& option, const LogString& value) override; void setLevelToMatch(const LogString& levelToMatch); diff --git a/src/main/include/log4cxx/filter/levelrangefilter.h b/src/main/include/log4cxx/filter/levelrangefilter.h index 9851e31ca..ac42c8217 100644 --- a/src/main/include/log4cxx/filter/levelrangefilter.h +++ b/src/main/include/log4cxx/filter/levelrangefilter.h @@ -73,8 +73,7 @@ class LOG4CXX_EXPORT LevelRangeFilter : public spi::Filter /** Set options */ - virtual void setOption(const LogString& option, - const LogString& value); + void setOption(const LogString& option, const LogString& value) override; /** Set the LevelMin option. diff --git a/src/main/include/log4cxx/filter/locationinfofilter.h b/src/main/include/log4cxx/filter/locationinfofilter.h index a2515da67..478c0b1fa 100644 --- a/src/main/include/log4cxx/filter/locationinfofilter.h +++ b/src/main/include/log4cxx/filter/locationinfofilter.h @@ -60,7 +60,7 @@ class LOG4CXX_EXPORT LocationInfoFilter: public log4cxx::spi::Filter LocationInfoFilter(); - void activateOptions(log4cxx::helpers::Pool&); + void activateOptions(log4cxx::helpers::Pool&) override; void setExpression(const LogString& expression); diff --git a/src/main/include/log4cxx/filter/loggermatchfilter.h b/src/main/include/log4cxx/filter/loggermatchfilter.h index 494213c89..76df5cc67 100644 --- a/src/main/include/log4cxx/filter/loggermatchfilter.h +++ b/src/main/include/log4cxx/filter/loggermatchfilter.h @@ -67,8 +67,7 @@ class LOG4CXX_EXPORT LoggerMatchFilter : public spi::Filter /** Set options */ - virtual void setOption(const LogString& option, - const LogString& value); + void setOption(const LogString& option, const LogString& value) override; void setLoggerToMatch(const LogString& levelToMatch); diff --git a/src/main/include/log4cxx/filter/mapfilter.h b/src/main/include/log4cxx/filter/mapfilter.h index 67c49c5af..4a9023ffc 100644 --- a/src/main/include/log4cxx/filter/mapfilter.h +++ b/src/main/include/log4cxx/filter/mapfilter.h @@ -60,8 +60,7 @@ class LOG4CXX_EXPORT MapFilter: public log4cxx::spi::Filter /** Set options */ - virtual void setOption(const LogString& option, - const LogString& value); + void setOption(const LogString& option, const LogString& value) override; void setKeyValue(const LogString& strKey, const LogString& strValue); diff --git a/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h b/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h index 0b48ec5ba..f27c7669d 100644 --- a/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h +++ b/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h @@ -67,8 +67,8 @@ class LOG4CXX_EXPORT OnlyOnceErrorHandler : /** No options to activate. */ - void activateOptions(log4cxx::helpers::Pool& p); - void setOption(const LogString& option, const LogString& value); + void activateOptions(log4cxx::helpers::Pool& p) override; + void setOption(const LogString& option, const LogString& value) override; /** diff --git a/src/main/include/log4cxx/htmllayout.h b/src/main/include/log4cxx/htmllayout.h index eb1e878b8..30b1fca66 100644 --- a/src/main/include/log4cxx/htmllayout.h +++ b/src/main/include/log4cxx/htmllayout.h @@ -81,12 +81,12 @@ class LOG4CXX_EXPORT HTMLLayout : public Layout /** No options to activate. */ - virtual void activateOptions(log4cxx::helpers::Pool& /* p */) {} + void activateOptions(log4cxx::helpers::Pool& /* p */) override {} /** Set options */ - virtual void setOption(const LogString& option, const LogString& value); + virtual void setOption(const LogString& option, const LogString& value) override; virtual void format(LogString& output, const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool) const; diff --git a/src/main/include/log4cxx/jsonlayout.h b/src/main/include/log4cxx/jsonlayout.h index 6314710b6..5db72fd6e 100644 --- a/src/main/include/log4cxx/jsonlayout.h +++ b/src/main/include/log4cxx/jsonlayout.h @@ -117,12 +117,12 @@ class LOG4CXX_EXPORT JSONLayout : public Layout /** No options to activate. */ - virtual void activateOptions(log4cxx::helpers::Pool& /* p */) {} + void activateOptions(log4cxx::helpers::Pool& /* p */) override {} /** Set options */ - virtual void setOption(const LogString& option, const LogString& value); + virtual void setOption(const LogString& option, const LogString& value) override; virtual void format(LogString& output, const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool) const; diff --git a/src/main/include/log4cxx/net/smtpappender.h b/src/main/include/log4cxx/net/smtpappender.h index 0838f440b..b9eed3586 100644 --- a/src/main/include/log4cxx/net/smtpappender.h +++ b/src/main/include/log4cxx/net/smtpappender.h @@ -82,13 +82,13 @@ class LOG4CXX_EXPORT SMTPAppender : public AppenderSkeleton /** Set options */ - virtual void setOption(const LogString& option, const LogString& value); + void setOption(const LogString& option, const LogString& value) override; /** Activate the specified options, such as the smtp host, the recipient, from, etc. */ - virtual void activateOptions(log4cxx::helpers::Pool& p); + void activateOptions(log4cxx::helpers::Pool& p) override; /** Perform SMTPAppender specific appending actions, mainly adding diff --git a/src/main/include/log4cxx/net/socketappenderskeleton.h b/src/main/include/log4cxx/net/socketappenderskeleton.h index 487801964..4a82b6255 100644 --- a/src/main/include/log4cxx/net/socketappenderskeleton.h +++ b/src/main/include/log4cxx/net/socketappenderskeleton.h @@ -123,8 +123,7 @@ class LOG4CXX_EXPORT SocketAppenderSkeleton : public AppenderSkeleton void fireConnector(); - void setOption(const LogString& option, - const LogString& value); + void setOption(const LogString& option, const LogString& value) override; protected: SocketAppenderSkeleton(std::unique_ptr priv); diff --git a/src/main/include/log4cxx/net/sockethubappender.h b/src/main/include/log4cxx/net/sockethubappender.h index 023eae7f9..b483aabf0 100644 --- a/src/main/include/log4cxx/net/sockethubappender.h +++ b/src/main/include/log4cxx/net/sockethubappender.h @@ -132,12 +132,12 @@ class LOG4CXX_EXPORT SocketHubAppender : public AppenderSkeleton /** Set up the socket server on the specified port. */ - virtual void activateOptions(log4cxx::helpers::Pool& p); + void activateOptions(log4cxx::helpers::Pool& p) override; /** Set options */ - virtual void setOption(const LogString& option, const LogString& value); + virtual void setOption(const LogString& option, const LogString& value) override; virtual void close(); diff --git a/src/main/include/log4cxx/net/syslogappender.h b/src/main/include/log4cxx/net/syslogappender.h index e401fab5a..098ef0d7d 100644 --- a/src/main/include/log4cxx/net/syslogappender.h +++ b/src/main/include/log4cxx/net/syslogappender.h @@ -84,8 +84,8 @@ class LOG4CXX_EXPORT SyslogAppender : public AppenderSkeleton This method returns immediately as options are activated when they are set. */ - void activateOptions(log4cxx::helpers::Pool& p); - void setOption(const LogString& option, const LogString& value); + void activateOptions(log4cxx::helpers::Pool& p) override; + void setOption(const LogString& option, const LogString& value) override; /** The SyslogAppender requires a layout. Hence, this method returns diff --git a/src/main/include/log4cxx/net/telnetappender.h b/src/main/include/log4cxx/net/telnetappender.h index e996755cc..b927e22a6 100644 --- a/src/main/include/log4cxx/net/telnetappender.h +++ b/src/main/include/log4cxx/net/telnetappender.h @@ -100,12 +100,12 @@ class LOG4CXX_EXPORT TelnetAppender : public AppenderSkeleton /** all of the options have been set, create the socket handler and wait for connections. */ - void activateOptions(log4cxx::helpers::Pool& p); + void activateOptions(log4cxx::helpers::Pool& p) override; /** Set options */ - virtual void setOption(const LogString& option, const LogString& value); + void setOption(const LogString& option, const LogString& value) override; /** Returns value of the Port option. diff --git a/src/main/include/log4cxx/nt/nteventlogappender.h b/src/main/include/log4cxx/nt/nteventlogappender.h index 366cce654..8965cd209 100644 --- a/src/main/include/log4cxx/nt/nteventlogappender.h +++ b/src/main/include/log4cxx/nt/nteventlogappender.h @@ -48,9 +48,9 @@ class LOG4CXX_EXPORT NTEventLogAppender : public AppenderSkeleton virtual ~NTEventLogAppender(); - virtual void activateOptions(log4cxx::helpers::Pool& p); + void activateOptions(log4cxx::helpers::Pool& p) override; virtual void close(); - virtual void setOption(const LogString& option, const LogString& value); + virtual void setOption(const LogString& option, const LogString& value) override; /** * The SocketAppender does not use a layout. Hence, this method diff --git a/src/main/include/log4cxx/patternlayout.h b/src/main/include/log4cxx/patternlayout.h index fb055e696..c8df97502 100644 --- a/src/main/include/log4cxx/patternlayout.h +++ b/src/main/include/log4cxx/patternlayout.h @@ -393,7 +393,7 @@ class LOG4CXX_EXPORT PatternLayout : public Layout /** * Call createPatternParser */ - virtual void activateOptions(log4cxx::helpers::Pool& p); + void activateOptions(log4cxx::helpers::Pool& p) override; virtual void setOption(const LogString& option, const LogString& value); diff --git a/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h b/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h index 3cb6a427f..d7bd03df1 100644 --- a/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h +++ b/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h @@ -111,9 +111,9 @@ class LOG4CXX_EXPORT FilterBasedTriggeringPolicy : public TriggeringPolicy /** * Prepares the instance for use. */ - void activateOptions(log4cxx::helpers::Pool&); + void activateOptions(log4cxx::helpers::Pool&) override; - void setOption(const LogString& option, const LogString& value); + void setOption(const LogString& option, const LogString& value) override; }; LOG4CXX_PTR_DEF(FilterBasedTriggeringPolicy); diff --git a/src/main/include/log4cxx/rolling/fixedwindowrollingpolicy.h b/src/main/include/log4cxx/rolling/fixedwindowrollingpolicy.h index f9e398495..a269d474e 100644 --- a/src/main/include/log4cxx/rolling/fixedwindowrollingpolicy.h +++ b/src/main/include/log4cxx/rolling/fixedwindowrollingpolicy.h @@ -90,9 +90,8 @@ class LOG4CXX_EXPORT FixedWindowRollingPolicy : public RollingPolicyBase FixedWindowRollingPolicy(); ~FixedWindowRollingPolicy(); - void activateOptions(log4cxx::helpers::Pool& p); - void setOption(const LogString& option, - const LogString& value); + void activateOptions(log4cxx::helpers::Pool& p) override; + void setOption(const LogString& option, const LogString& value) override; void rollover(); diff --git a/src/main/include/log4cxx/rolling/manualtriggeringpolicy.h b/src/main/include/log4cxx/rolling/manualtriggeringpolicy.h index 49122f0f4..54224db7e 100644 --- a/src/main/include/log4cxx/rolling/manualtriggeringpolicy.h +++ b/src/main/include/log4cxx/rolling/manualtriggeringpolicy.h @@ -67,8 +67,8 @@ class LOG4CXX_EXPORT ManualTriggeringPolicy : public TriggeringPolicy const LogString& filename, size_t fileLength); - void activateOptions(log4cxx::helpers::Pool&); - void setOption(const LogString& option, const LogString& value); + void activateOptions(log4cxx::helpers::Pool&) override; + void setOption(const LogString& option, const LogString& value) override; }; } } diff --git a/src/main/include/log4cxx/rolling/multiprocessrollingfileappender.h b/src/main/include/log4cxx/rolling/multiprocessrollingfileappender.h index 717b2d5b0..7f87c01d0 100644 --- a/src/main/include/log4cxx/rolling/multiprocessrollingfileappender.h +++ b/src/main/include/log4cxx/rolling/multiprocessrollingfileappender.h @@ -47,7 +47,7 @@ class LOG4CXX_EXPORT MultiprocessRollingFileAppender : public FileAppender public: MultiprocessRollingFileAppender(); - void activateOptions(log4cxx::helpers::Pool&); + void activateOptions(log4cxx::helpers::Pool&) override; /** diff --git a/src/main/include/log4cxx/rolling/rollingfileappender.h b/src/main/include/log4cxx/rolling/rollingfileappender.h index 6d0e92439..bb881df92 100644 --- a/src/main/include/log4cxx/rolling/rollingfileappender.h +++ b/src/main/include/log4cxx/rolling/rollingfileappender.h @@ -130,7 +130,7 @@ class LOG4CXX_EXPORT RollingFileAppender : public FileAppender void setOption( const LogString& option, const LogString& value ) override; /** Prepares RollingFileAppender for use. */ - void activateOptions( log4cxx::helpers::Pool& pool ); + void activateOptions(log4cxx::helpers::Pool& pool ) override; /** Implements the usual roll over behaviour. diff --git a/src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h b/src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h index c47b40ac2..af08145e5 100644 --- a/src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h +++ b/src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h @@ -74,8 +74,8 @@ class LOG4CXX_EXPORT SizeBasedTriggeringPolicy : public TriggeringPolicy void setMaxFileSize(size_t l); - void activateOptions(log4cxx::helpers::Pool&); - void setOption(const LogString& option, const LogString& value); + void activateOptions(log4cxx::helpers::Pool&) override; + void setOption(const LogString& option, const LogString& value) override; }; LOG4CXX_PTR_DEF(SizeBasedTriggeringPolicy); diff --git a/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h b/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h index 54ef05a71..429f8a0fc 100755 --- a/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h +++ b/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h @@ -158,7 +158,7 @@ class LOG4CXX_EXPORT TimeBasedRollingPolicy : public RollingPolicyBase, public: TimeBasedRollingPolicy(); virtual ~TimeBasedRollingPolicy(); - void activateOptions(log4cxx::helpers::Pool& ); + void activateOptions(log4cxx::helpers::Pool& ) override; void setMultiprocess(bool multiprocess); diff --git a/src/main/include/log4cxx/simplelayout.h b/src/main/include/log4cxx/simplelayout.h index 58996386d..421e08367 100644 --- a/src/main/include/log4cxx/simplelayout.h +++ b/src/main/include/log4cxx/simplelayout.h @@ -71,8 +71,8 @@ class LOG4CXX_EXPORT SimpleLayout : public Layout return true; } - virtual void activateOptions(log4cxx::helpers::Pool& /* p */) {} - virtual void setOption(const LogString& /* option */, + void activateOptions(log4cxx::helpers::Pool& /* p */) override {} + void setOption(const LogString& /* option */, const LogString& /* value */) {} }; LOG4CXX_PTR_DEF(SimpleLayout); diff --git a/src/main/include/log4cxx/spi/filter.h b/src/main/include/log4cxx/spi/filter.h index 6c2dfe595..88d990e9f 100644 --- a/src/main/include/log4cxx/spi/filter.h +++ b/src/main/include/log4cxx/spi/filter.h @@ -65,8 +65,7 @@ Linux ipchains.

Note that filtering is only supported by the {@link xml::DOMConfigurator DOMConfigurator}. */ -class LOG4CXX_EXPORT Filter : public virtual OptionHandler, - public virtual helpers::Object +class LOG4CXX_EXPORT Filter : public virtual OptionHandler { protected: LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(FilterPrivate, m_priv) @@ -110,8 +109,8 @@ class LOG4CXX_EXPORT Filter : public virtual OptionHandler, default do-nothing implementation for convenience. */ - void activateOptions(log4cxx::helpers::Pool& p); - void setOption(const LogString& option, const LogString& value); + void activateOptions(log4cxx::helpers::Pool& p) override; + void setOption(const LogString& option, const LogString& value) override override; /**

If the decision is DENY, then the event will be diff --git a/src/main/include/log4cxx/varia/fallbackerrorhandler.h b/src/main/include/log4cxx/varia/fallbackerrorhandler.h index e49e638bb..e765d1c03 100644 --- a/src/main/include/log4cxx/varia/fallbackerrorhandler.h +++ b/src/main/include/log4cxx/varia/fallbackerrorhandler.h @@ -65,7 +65,7 @@ class LOG4CXX_EXPORT FallbackErrorHandler : No options to activate. */ void activateOptions(log4cxx::helpers::Pool& p); - void setOption(const LogString& option, const LogString& value); + void setOption(const LogString& option, const LogString& value) override; /** diff --git a/src/main/include/log4cxx/writerappender.h b/src/main/include/log4cxx/writerappender.h index 8b276918f..b5de22ca4 100644 --- a/src/main/include/log4cxx/writerappender.h +++ b/src/main/include/log4cxx/writerappender.h @@ -66,7 +66,7 @@ class LOG4CXX_EXPORT WriterAppender : public AppenderSkeleton Derived appenders should override this method if option structure requires it. */ - virtual void activateOptions(log4cxx::helpers::Pool& pool); + void activateOptions(log4cxx::helpers::Pool& pool) override; /** If the ImmediateFlush option is set to @@ -140,8 +140,7 @@ class LOG4CXX_EXPORT WriterAppender : public AppenderSkeleton public: LogString getEncoding() const; void setEncoding(const LogString& value); - void setOption(const LogString& option, - const LogString& value); + void setOption(const LogString& option, const LogString& value) override; /**

Sets the Writer where the log output will go. The diff --git a/src/main/include/log4cxx/xml/xmllayout.h b/src/main/include/log4cxx/xml/xmllayout.h index 90eda7908..96846e71f 100644 --- a/src/main/include/log4cxx/xml/xmllayout.h +++ b/src/main/include/log4cxx/xml/xmllayout.h @@ -104,7 +104,7 @@ class LOG4CXX_EXPORT XMLLayout : public Layout /** Set options */ - virtual void setOption(const LogString& option, + void setOption(const LogString& option, const LogString& value); /** From 4c2ee0e5bc8541a2db6691fdc58f57e0b6fc50fe Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sun, 13 Nov 2022 10:26:18 +1100 Subject: [PATCH 07/17] Prevent Clang warning messages --- src/main/include/log4cxx/appenderskeleton.h | 16 ++++++++-------- src/main/include/log4cxx/asyncappender.h | 12 ++++++------ src/main/include/log4cxx/db/odbcappender.h | 4 ++-- .../log4cxx/helpers/onlyonceerrorhandler.h | 12 ++++++------ src/main/include/log4cxx/net/smtpappender.h | 6 +++--- .../include/log4cxx/net/socketappenderskeleton.h | 6 +++--- src/main/include/log4cxx/net/sockethubappender.h | 8 ++++---- src/main/include/log4cxx/net/syslogappender.h | 6 +++--- src/main/include/log4cxx/net/telnetappender.h | 6 +++--- src/main/include/log4cxx/nt/nteventlogappender.h | 6 +++--- .../log4cxx/nt/outputdebugstringappender.h | 6 +++--- .../rolling/filterbasedtriggeringpolicy.h | 2 +- .../rolling/multiprocessrollingfileappender.h | 2 +- .../log4cxx/rolling/rollingfileappender.h | 2 +- src/main/include/log4cxx/spi/filter.h | 2 +- .../include/log4cxx/varia/fallbackerrorhandler.h | 14 +++++++------- src/main/include/log4cxx/writerappender.h | 6 +++--- 17 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/main/include/log4cxx/appenderskeleton.h b/src/main/include/log4cxx/appenderskeleton.h index 6550e4904..d1e7def63 100644 --- a/src/main/include/log4cxx/appenderskeleton.h +++ b/src/main/include/log4cxx/appenderskeleton.h @@ -80,13 +80,13 @@ class LOG4CXX_EXPORT AppenderSkeleton : /** Add a filter to end of the filter list. */ - void addFilter(const spi::FilterPtr newFilter) ; + void addFilter(const spi::FilterPtr newFilter) override; public: /** Clear the filters chain. */ - void clearFilters(); + void clearFilters() override; /** Return the currently set spi::ErrorHandler for this @@ -97,7 +97,7 @@ class LOG4CXX_EXPORT AppenderSkeleton : /** Returns the head Filter. */ - spi::FilterPtr getFilter() const; + spi::FilterPtr getFilter() const override; /** Return the first filter in the filter chain for this @@ -109,13 +109,13 @@ class LOG4CXX_EXPORT AppenderSkeleton : /** Returns the layout of this appender. The value may be nullptr. */ - LayoutPtr getLayout() const; + LayoutPtr getLayout() const override; /** Returns the name of this Appender. */ - LogString getName() const; + LogString getName() const override; /** Returns this appenders threshold level. See the #setThreshold @@ -136,7 +136,7 @@ class LOG4CXX_EXPORT AppenderSkeleton : * delegating actual logging to the subclasses specific * AppenderSkeleton#append method. * */ - virtual void doAppend(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool); + void doAppend(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool) override; /** Set the {@link spi::ErrorHandler ErrorHandler} for this Appender. @@ -149,12 +149,12 @@ class LOG4CXX_EXPORT AppenderSkeleton : {@link net::SocketAppender SocketAppender} ignores the layout set here. */ - void setLayout(const LayoutPtr layout1); + void setLayout(const LayoutPtr layout1) override; /** Set the name of this Appender. */ - void setName(const LogString& name1); + void setName(const LogString& name1) override; /** diff --git a/src/main/include/log4cxx/asyncappender.h b/src/main/include/log4cxx/asyncappender.h index e6c75179d..9a171e18e 100644 --- a/src/main/include/log4cxx/asyncappender.h +++ b/src/main/include/log4cxx/asyncappender.h @@ -85,17 +85,17 @@ class LOG4CXX_EXPORT AsyncAppender : */ void addAppender(const AppenderPtr newAppender) override; - virtual void doAppend(const spi::LoggingEventPtr& event, - log4cxx::helpers::Pool& pool1); + void doAppend(const spi::LoggingEventPtr& event, + log4cxx::helpers::Pool& pool1) override; - void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p); + void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; /** Close this AsyncAppender by interrupting the dispatcher thread which will process all pending events before exiting. */ - void close(); + void close() override; /** * Get iterator over attached appenders. @@ -109,7 +109,7 @@ class LOG4CXX_EXPORT AsyncAppender : * @param name name, may not be null. * @return matching appender or null. */ - AppenderPtr getAppender(const LogString& name) const; + AppenderPtr getAppender(const LogString& name) const override; /** * Gets whether the location of the logging request call @@ -125,7 +125,7 @@ class LOG4CXX_EXPORT AsyncAppender : */ bool isAttached(const AppenderPtr appender) const override; - virtual bool requiresLayout() const; + bool requiresLayout() const override; /** * Removes and closes all attached appenders. diff --git a/src/main/include/log4cxx/db/odbcappender.h b/src/main/include/log4cxx/db/odbcappender.h index 1939442d1..25aff4994 100644 --- a/src/main/include/log4cxx/db/odbcappender.h +++ b/src/main/include/log4cxx/db/odbcappender.h @@ -173,7 +173,7 @@ class LOG4CXX_EXPORT ODBCAppender : public AppenderSkeleton * connection if it is open. */ public: - virtual void close(); + void close() override; /** * loops through the buffer of LoggingEvents, gets a @@ -187,7 +187,7 @@ class LOG4CXX_EXPORT ODBCAppender : public AppenderSkeleton /** * ODBCAppender requires a layout. * */ - virtual bool requiresLayout() const + bool requiresLayout() const override { return true; } diff --git a/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h b/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h index f27c7669d..e02ff3b00 100644 --- a/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h +++ b/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h @@ -61,7 +61,7 @@ class LOG4CXX_EXPORT OnlyOnceErrorHandler : /** Does not do anything. */ - void setLogger(const LoggerPtr& logger); + void setLogger(const LoggerPtr& logger) override; /** @@ -75,29 +75,29 @@ class LOG4CXX_EXPORT OnlyOnceErrorHandler : Prints the message and the stack trace of the exception on System.err. */ void error(const LogString& message, const std::exception& e, - int errorCode) const; + int errorCode) const override; /** Prints the message and the stack trace of the exception on System.err. */ void error(const LogString& message, const std::exception& e, - int errorCode, const spi::LoggingEventPtr& event) const; + int errorCode, const spi::LoggingEventPtr& event) const override; /** Print a the error message passed as parameter on System.err. */ - void error(const LogString& message) const; + void error(const LogString& message) const override; /** Does not do anything. */ - void setAppender(const AppenderPtr& appender); + void setAppender(const AppenderPtr& appender) override; /** Does not do anything. */ - void setBackupAppender(const AppenderPtr& appender); + void setBackupAppender(const AppenderPtr& appender) override; }; } // namespace helpers } // namespace log4cxx diff --git a/src/main/include/log4cxx/net/smtpappender.h b/src/main/include/log4cxx/net/smtpappender.h index b9eed3586..a1c03c915 100644 --- a/src/main/include/log4cxx/net/smtpappender.h +++ b/src/main/include/log4cxx/net/smtpappender.h @@ -94,10 +94,10 @@ class LOG4CXX_EXPORT SMTPAppender : public AppenderSkeleton Perform SMTPAppender specific appending actions, mainly adding the event to a cyclic buffer and checking if the event triggers an e-mail to be sent. */ - virtual void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p); + void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; - virtual void close(); + void close() override; /** Returns value of the To option. @@ -118,7 +118,7 @@ class LOG4CXX_EXPORT SMTPAppender : public AppenderSkeleton /** The SMTPAppender requires a {@link Layout layout}. */ - virtual bool requiresLayout() const; + bool requiresLayout() const override; /** Send the contents of the cyclic buffer as an e-mail message. diff --git a/src/main/include/log4cxx/net/socketappenderskeleton.h b/src/main/include/log4cxx/net/socketappenderskeleton.h index 4a82b6255..db0744984 100644 --- a/src/main/include/log4cxx/net/socketappenderskeleton.h +++ b/src/main/include/log4cxx/net/socketappenderskeleton.h @@ -55,9 +55,9 @@ class LOG4CXX_EXPORT SocketAppenderSkeleton : public AppenderSkeleton /** Connect to the specified RemoteHost and Port. */ - void activateOptions(log4cxx::helpers::Pool& p); + void activateOptions(log4cxx::helpers::Pool& p) override; - void close(); + void close() override; /** @@ -65,7 +65,7 @@ class LOG4CXX_EXPORT SocketAppenderSkeleton : public AppenderSkeleton * returns false. * */ - bool requiresLayout() const + bool requiresLayout() const override { return false; } diff --git a/src/main/include/log4cxx/net/sockethubappender.h b/src/main/include/log4cxx/net/sockethubappender.h index b483aabf0..7156ce00d 100644 --- a/src/main/include/log4cxx/net/sockethubappender.h +++ b/src/main/include/log4cxx/net/sockethubappender.h @@ -137,18 +137,18 @@ class LOG4CXX_EXPORT SocketHubAppender : public AppenderSkeleton /** Set options */ - virtual void setOption(const LogString& option, const LogString& value) override; + void setOption(const LogString& option, const LogString& value) override; - virtual void close(); + void close() override; /** Append an event to all of current connections. */ - virtual void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p); + void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; /** The SocketHubAppender does not use a layout. Hence, this method returns false. */ - virtual bool requiresLayout() const + bool requiresLayout() const override { return false; } diff --git a/src/main/include/log4cxx/net/syslogappender.h b/src/main/include/log4cxx/net/syslogappender.h index 098ef0d7d..62c4ba636 100644 --- a/src/main/include/log4cxx/net/syslogappender.h +++ b/src/main/include/log4cxx/net/syslogappender.h @@ -60,7 +60,7 @@ class LOG4CXX_EXPORT SyslogAppender : public AppenderSkeleton const LogString& syslogHost, int syslogFacility); ~SyslogAppender(); /** Release any resources held by this SyslogAppender.*/ - void close(); + void close() override; /** Returns the specified syslog facility as a lower-case String, @@ -78,7 +78,7 @@ class LOG4CXX_EXPORT SyslogAppender : public AppenderSkeleton */ static int getFacility(const LogString& facilityName); - void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p); + void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; /** This method returns immediately as options are activated when they @@ -91,7 +91,7 @@ class LOG4CXX_EXPORT SyslogAppender : public AppenderSkeleton The SyslogAppender requires a layout. Hence, this method returns true. */ - virtual bool requiresLayout() const + bool requiresLayout() const override { return true; } diff --git a/src/main/include/log4cxx/net/telnetappender.h b/src/main/include/log4cxx/net/telnetappender.h index b927e22a6..02a423dbd 100644 --- a/src/main/include/log4cxx/net/telnetappender.h +++ b/src/main/include/log4cxx/net/telnetappender.h @@ -89,7 +89,7 @@ class LOG4CXX_EXPORT TelnetAppender : public AppenderSkeleton /** This appender requires a layout to format the text to the attached client(s). */ - virtual bool requiresLayout() const + bool requiresLayout() const override { return true; } @@ -120,12 +120,12 @@ class LOG4CXX_EXPORT TelnetAppender : public AppenderSkeleton /** shuts down the appender. */ - void close(); + void close() override; protected: /** Handles a log event. For this appender, that means writing the message to each connected client. */ - virtual void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) ; + void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; //---------------------------------------------------------- SocketHandler: diff --git a/src/main/include/log4cxx/nt/nteventlogappender.h b/src/main/include/log4cxx/nt/nteventlogappender.h index 8965cd209..097cf9c3b 100644 --- a/src/main/include/log4cxx/nt/nteventlogappender.h +++ b/src/main/include/log4cxx/nt/nteventlogappender.h @@ -49,15 +49,15 @@ class LOG4CXX_EXPORT NTEventLogAppender : public AppenderSkeleton virtual ~NTEventLogAppender(); void activateOptions(log4cxx::helpers::Pool& p) override; - virtual void close(); - virtual void setOption(const LogString& option, const LogString& value) override; + void close() override; + void setOption(const LogString& option, const LogString& value) override; /** * The SocketAppender does not use a layout. Hence, this method * returns false. * */ - bool requiresLayout() const + bool requiresLayout() const override { return true; } diff --git a/src/main/include/log4cxx/nt/outputdebugstringappender.h b/src/main/include/log4cxx/nt/outputdebugstringappender.h index 47aaccedc..870e340b7 100644 --- a/src/main/include/log4cxx/nt/outputdebugstringappender.h +++ b/src/main/include/log4cxx/nt/outputdebugstringappender.h @@ -35,14 +35,14 @@ class LOG4CXX_EXPORT OutputDebugStringAppender : public AppenderSkeleton OutputDebugStringAppender(); - bool requiresLayout() const + bool requiresLayout() const override { return true; } - virtual void close() {} + void close() override {} - virtual void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p); + void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; }; } } diff --git a/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h b/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h index d7bd03df1..7e732c256 100644 --- a/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h +++ b/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h @@ -106,7 +106,7 @@ class LOG4CXX_EXPORT FilterBasedTriggeringPolicy : public TriggeringPolicy * Returns the head Filter. * */ - log4cxx::spi::FilterPtr& getFilter(); + spi::FilterPtr& getFilter(); /** * Prepares the instance for use. diff --git a/src/main/include/log4cxx/rolling/multiprocessrollingfileappender.h b/src/main/include/log4cxx/rolling/multiprocessrollingfileappender.h index 7f87c01d0..237f63477 100644 --- a/src/main/include/log4cxx/rolling/multiprocessrollingfileappender.h +++ b/src/main/include/log4cxx/rolling/multiprocessrollingfileappender.h @@ -95,7 +95,7 @@ class LOG4CXX_EXPORT MultiprocessRollingFileAppender : public FileAppender /** * Close appender. Waits for any asynchronous file compression actions to be completed. */ - void close(); + void close() override; protected: /** diff --git a/src/main/include/log4cxx/rolling/rollingfileappender.h b/src/main/include/log4cxx/rolling/rollingfileappender.h index bb881df92..fcc8609dc 100644 --- a/src/main/include/log4cxx/rolling/rollingfileappender.h +++ b/src/main/include/log4cxx/rolling/rollingfileappender.h @@ -177,7 +177,7 @@ class LOG4CXX_EXPORT RollingFileAppender : public FileAppender /** * Close appender. Waits for any asynchronous file compression actions to be completed. */ - void close(); + void close() override; protected: /** diff --git a/src/main/include/log4cxx/spi/filter.h b/src/main/include/log4cxx/spi/filter.h index 88d990e9f..ad3b4605d 100644 --- a/src/main/include/log4cxx/spi/filter.h +++ b/src/main/include/log4cxx/spi/filter.h @@ -110,7 +110,7 @@ class LOG4CXX_EXPORT Filter : public virtual OptionHandler default do-nothing implementation for convenience. */ void activateOptions(log4cxx::helpers::Pool& p) override; - void setOption(const LogString& option, const LogString& value) override override; + void setOption(const LogString& option, const LogString& value) override; /**

If the decision is DENY, then the event will be diff --git a/src/main/include/log4cxx/varia/fallbackerrorhandler.h b/src/main/include/log4cxx/varia/fallbackerrorhandler.h index e765d1c03..623c85d9a 100644 --- a/src/main/include/log4cxx/varia/fallbackerrorhandler.h +++ b/src/main/include/log4cxx/varia/fallbackerrorhandler.h @@ -58,13 +58,13 @@ class LOG4CXX_EXPORT FallbackErrorHandler : Adds the logger passed as parameter to the list of loggers that we need to search for in case of appender failure. */ - void setLogger(const LoggerPtr& logger); + void setLogger(const LoggerPtr& logger) override; /** No options to activate. */ - void activateOptions(log4cxx::helpers::Pool& p); + void activateOptions(log4cxx::helpers::Pool& p) override; void setOption(const LogString& option, const LogString& value) override; @@ -73,31 +73,31 @@ class LOG4CXX_EXPORT FallbackErrorHandler : System.err. */ void error(const LogString& message, const std::exception& e, - int errorCode) const; + int errorCode) const override; /** Prints the message and the stack trace of the exception on System.err. */ void error(const LogString& message, const std::exception& e, - int errorCode, const spi::LoggingEventPtr& event) const; + int errorCode, const spi::LoggingEventPtr& event) const override; /** Print a the error message passed as parameter on System.err. */ - void error(const LogString& /* message */) const {} + void error(const LogString& /* message */) const override {} /** The appender to which this error handler is attached. */ - void setAppender(const AppenderPtr& primary); + void setAppender(const AppenderPtr& primary) override; /** Set the backup appender. */ - void setBackupAppender(const AppenderPtr& backup); + void setBackupAppender(const AppenderPtr& backup) override; }; LOG4CXX_PTR_DEF(FallbackErrorHandler); diff --git a/src/main/include/log4cxx/writerappender.h b/src/main/include/log4cxx/writerappender.h index b5de22ca4..56c687d7a 100644 --- a/src/main/include/log4cxx/writerappender.h +++ b/src/main/include/log4cxx/writerappender.h @@ -100,7 +100,7 @@ class LOG4CXX_EXPORT WriterAppender : public AppenderSkeleton layout. */ - virtual void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p); + void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; protected: @@ -120,7 +120,7 @@ class LOG4CXX_EXPORT WriterAppender : public AppenderSkeleton

Closed appenders cannot be reused. */ - virtual void close(); + void close() override; protected: /** @@ -158,7 +158,7 @@ class LOG4CXX_EXPORT WriterAppender : public AppenderSkeleton const log4cxx::helpers::WriterPtr getWriter() const; - virtual bool requiresLayout() const; + bool requiresLayout() const override; protected: /** From 0275b625ed7b98067e9044e4acbe6e000fe37e90 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sun, 13 Nov 2022 12:29:20 +1100 Subject: [PATCH 08/17] Prevent Clang warning messages --- src/main/include/log4cxx/appenderskeleton.h | 2 +- src/main/include/log4cxx/filter/denyallfilter.h | 2 +- src/main/include/log4cxx/filter/expressionfilter.h | 2 +- src/main/include/log4cxx/filter/levelmatchfilter.h | 2 +- src/main/include/log4cxx/filter/levelrangefilter.h | 2 +- .../include/log4cxx/filter/locationinfofilter.h | 2 +- .../include/log4cxx/filter/loggermatchfilter.h | 2 +- src/main/include/log4cxx/filter/mapfilter.h | 2 +- src/main/include/log4cxx/filter/propertyfilter.h | 2 +- .../include/log4cxx/filter/stringmatchfilter.h | 2 +- src/main/include/log4cxx/helpers/bufferedwriter.h | 6 +++--- .../include/log4cxx/helpers/inputstreamreader.h | 4 ++-- .../include/log4cxx/helpers/outputstreamwriter.h | 6 +++--- src/main/include/log4cxx/helpers/systemerrwriter.h | 6 +++--- src/main/include/log4cxx/helpers/systemoutwriter.h | 6 +++--- src/main/include/log4cxx/htmllayout.h | 14 +++++++------- src/main/include/log4cxx/jsonlayout.h | 10 +++++----- src/main/include/log4cxx/net/xmlsocketappender.h | 10 +++++----- .../log4cxx/pattern/classnamepatternconverter.h | 2 +- .../log4cxx/pattern/colorendpatternconverter.h | 2 +- .../log4cxx/pattern/colorstartpatternconverter.h | 2 +- .../include/log4cxx/pattern/datepatternconverter.h | 2 +- .../log4cxx/pattern/filelocationpatternconverter.h | 2 +- .../log4cxx/pattern/fulllocationpatternconverter.h | 2 +- .../log4cxx/pattern/levelpatternconverter.h | 2 +- .../log4cxx/pattern/linelocationpatternconverter.h | 2 +- .../pattern/lineseparatorpatternconverter.h | 2 +- .../log4cxx/pattern/literalpatternconverter.h | 2 +- .../log4cxx/pattern/loggerpatternconverter.h | 2 +- .../log4cxx/pattern/loggingeventpatternconverter.h | 2 +- .../log4cxx/pattern/messagepatternconverter.h | 2 +- .../pattern/methodlocationpatternconverter.h | 2 +- .../include/log4cxx/pattern/ndcpatternconverter.h | 2 +- .../pattern/shortfilelocationpatternconverter.h | 2 +- .../log4cxx/pattern/threadpatternconverter.h | 2 +- .../pattern/throwableinformationpatternconverter.h | 2 +- src/main/include/log4cxx/patternlayout.h | 8 ++++---- src/main/include/log4cxx/simplelayout.h | 8 ++++---- src/main/include/log4cxx/xml/xmllayout.h | 10 +++++----- 39 files changed, 72 insertions(+), 72 deletions(-) diff --git a/src/main/include/log4cxx/appenderskeleton.h b/src/main/include/log4cxx/appenderskeleton.h index d1e7def63..b0b95b0b2 100644 --- a/src/main/include/log4cxx/appenderskeleton.h +++ b/src/main/include/log4cxx/appenderskeleton.h @@ -74,7 +74,7 @@ class LOG4CXX_EXPORT AppenderSkeleton : Derived appenders should override this method if option structure requires it. */ - virtual void activateOptions(log4cxx::helpers::Pool& /* pool */) {} + virtual void activateOptions(log4cxx::helpers::Pool& /* pool */) override {} virtual void setOption(const LogString& option, const LogString& value) override; /** diff --git a/src/main/include/log4cxx/filter/denyallfilter.h b/src/main/include/log4cxx/filter/denyallfilter.h index 9c0ee624b..eb6746c05 100644 --- a/src/main/include/log4cxx/filter/denyallfilter.h +++ b/src/main/include/log4cxx/filter/denyallfilter.h @@ -58,7 +58,7 @@ class LOG4CXX_EXPORT DenyAllFilter : public spi::Filter @param event The LoggingEvent to filter. @return Always returns {@link spi::Filter#DENY DENY}. */ - FilterDecision decide(const spi::LoggingEventPtr& event) const + FilterDecision decide(const spi::LoggingEventPtr& event) const override { return spi::Filter::DENY; } diff --git a/src/main/include/log4cxx/filter/expressionfilter.h b/src/main/include/log4cxx/filter/expressionfilter.h index 6ea751dfb..baf218853 100644 --- a/src/main/include/log4cxx/filter/expressionfilter.h +++ b/src/main/include/log4cxx/filter/expressionfilter.h @@ -117,7 +117,7 @@ class LOG4CXX_EXPORT ExpressionFilter: public log4cxx::spi::Filter /** Returns {@link log4cxx::spi::Filter#NEUTRAL} is there is no string match. */ - FilterDecision decide(const spi::LoggingEventPtr& event) const; + FilterDecision decide(const spi::LoggingEventPtr& event) const override; }; } } diff --git a/src/main/include/log4cxx/filter/levelmatchfilter.h b/src/main/include/log4cxx/filter/levelmatchfilter.h index c775ac92a..6240bc4f3 100644 --- a/src/main/include/log4cxx/filter/levelmatchfilter.h +++ b/src/main/include/log4cxx/filter/levelmatchfilter.h @@ -86,7 +86,7 @@ class LOG4CXX_EXPORT LevelMatchFilter : public spi::Filter {@link spi::Filter#DENY DENY} if the AcceptOnMatch property is set to false. */ - FilterDecision decide(const spi::LoggingEventPtr& event) const; + FilterDecision decide(const spi::LoggingEventPtr& event) const override; }; // class LevelMatchFilter LOG4CXX_PTR_DEF(LevelMatchFilter); } // namespace filter diff --git a/src/main/include/log4cxx/filter/levelrangefilter.h b/src/main/include/log4cxx/filter/levelrangefilter.h index ac42c8217..8a69b9832 100644 --- a/src/main/include/log4cxx/filter/levelrangefilter.h +++ b/src/main/include/log4cxx/filter/levelrangefilter.h @@ -116,7 +116,7 @@ class LOG4CXX_EXPORT LevelRangeFilter : public spi::Filter returned decision is {@link spi::Filter#DENY DENY} if the AcceptOnMatch property is set to false. */ - FilterDecision decide(const spi::LoggingEventPtr& event) const; + FilterDecision decide(const spi::LoggingEventPtr& event) const override; }; // class LevelRangeFilter LOG4CXX_PTR_DEF(LevelRangeFilter); } // namespace filter diff --git a/src/main/include/log4cxx/filter/locationinfofilter.h b/src/main/include/log4cxx/filter/locationinfofilter.h index 478c0b1fa..ca72716b9 100644 --- a/src/main/include/log4cxx/filter/locationinfofilter.h +++ b/src/main/include/log4cxx/filter/locationinfofilter.h @@ -79,7 +79,7 @@ class LOG4CXX_EXPORT LocationInfoFilter: public log4cxx::spi::Filter * * Returns {@link log4cxx::spi::Filter#NEUTRAL} */ - FilterDecision decide(const spi::LoggingEventPtr& event) const; + FilterDecision decide(const spi::LoggingEventPtr& event) const override; }; } diff --git a/src/main/include/log4cxx/filter/loggermatchfilter.h b/src/main/include/log4cxx/filter/loggermatchfilter.h index 76df5cc67..7b7c3c202 100644 --- a/src/main/include/log4cxx/filter/loggermatchfilter.h +++ b/src/main/include/log4cxx/filter/loggermatchfilter.h @@ -88,7 +88,7 @@ class LOG4CXX_EXPORT LoggerMatchFilter : public spi::Filter {@link spi::Filter#DENY DENY} if the AcceptOnMatch property is set to false. */ - FilterDecision decide(const spi::LoggingEventPtr& event) const; + FilterDecision decide(const spi::LoggingEventPtr& event) const override; }; // class LoggerMatchFilter LOG4CXX_PTR_DEF(LoggerMatchFilter); } // namespace filter diff --git a/src/main/include/log4cxx/filter/mapfilter.h b/src/main/include/log4cxx/filter/mapfilter.h index 4a9023ffc..c6cf5c672 100644 --- a/src/main/include/log4cxx/filter/mapfilter.h +++ b/src/main/include/log4cxx/filter/mapfilter.h @@ -78,7 +78,7 @@ class LOG4CXX_EXPORT MapFilter: public log4cxx::spi::Filter Returns {@link log4cxx::spi::Filter#NEUTRAL NEUTRAL} is there is no string match. */ - FilterDecision decide(const spi::LoggingEventPtr& event) const; + FilterDecision decide(const spi::LoggingEventPtr& event) const override; }; // class MapFilter LOG4CXX_PTR_DEF(MapFilter); diff --git a/src/main/include/log4cxx/filter/propertyfilter.h b/src/main/include/log4cxx/filter/propertyfilter.h index 2f1f8cbd2..a360021d3 100644 --- a/src/main/include/log4cxx/filter/propertyfilter.h +++ b/src/main/include/log4cxx/filter/propertyfilter.h @@ -67,7 +67,7 @@ class LOG4CXX_EXPORT PropertyFilter : public log4cxx::spi::Filter ~PropertyFilter(); void setProperties(const LogString& props); - FilterDecision decide(const spi::LoggingEventPtr& event) const; + FilterDecision decide(const spi::LoggingEventPtr& event) const override; }; diff --git a/src/main/include/log4cxx/filter/stringmatchfilter.h b/src/main/include/log4cxx/filter/stringmatchfilter.h index 1091ea185..5da8f8240 100644 --- a/src/main/include/log4cxx/filter/stringmatchfilter.h +++ b/src/main/include/log4cxx/filter/stringmatchfilter.h @@ -84,7 +84,7 @@ class LOG4CXX_EXPORT StringMatchFilter : public spi::Filter Returns {@link log4cxx::spi::Filter#NEUTRAL NEUTRAL} is there is no string match. */ - FilterDecision decide(const spi::LoggingEventPtr& event) const; + FilterDecision decide(const spi::LoggingEventPtr& event) const override; }; // class StringMatchFilter LOG4CXX_PTR_DEF(StringMatchFilter); } // namespace filter diff --git a/src/main/include/log4cxx/helpers/bufferedwriter.h b/src/main/include/log4cxx/helpers/bufferedwriter.h index 49a01d353..5f165f6b5 100644 --- a/src/main/include/log4cxx/helpers/bufferedwriter.h +++ b/src/main/include/log4cxx/helpers/bufferedwriter.h @@ -46,9 +46,9 @@ class LOG4CXX_EXPORT BufferedWriter : public Writer BufferedWriter(WriterPtr& out, size_t sz); virtual ~BufferedWriter(); - virtual void close(Pool& p); - virtual void flush(Pool& p); - virtual void write(const LogString& str, Pool& p); + void close(Pool& p) override; + void flush(Pool& p) override; + void write(const LogString& str, Pool& p) override; private: BufferedWriter(const BufferedWriter&); diff --git a/src/main/include/log4cxx/helpers/inputstreamreader.h b/src/main/include/log4cxx/helpers/inputstreamreader.h index bdd1d5d2a..d3fd8581e 100644 --- a/src/main/include/log4cxx/helpers/inputstreamreader.h +++ b/src/main/include/log4cxx/helpers/inputstreamreader.h @@ -72,13 +72,13 @@ class LOG4CXX_EXPORT InputStreamReader : public Reader * * @param p The memory pool associated with the reader. */ - virtual void close(Pool& p); + void close(Pool& p) override; /** * @return The complete stream contents as a LogString. * @param p The memory pool associated with the reader. */ - virtual LogString read(Pool& p); + LogString read(Pool& p) override; /** * @return The name of the character encoding being used by this stream. diff --git a/src/main/include/log4cxx/helpers/outputstreamwriter.h b/src/main/include/log4cxx/helpers/outputstreamwriter.h index 7f2a196b5..fa6073a6e 100644 --- a/src/main/include/log4cxx/helpers/outputstreamwriter.h +++ b/src/main/include/log4cxx/helpers/outputstreamwriter.h @@ -47,9 +47,9 @@ class LOG4CXX_EXPORT OutputStreamWriter : public Writer OutputStreamWriter(OutputStreamPtr& out, CharsetEncoderPtr& enc); ~OutputStreamWriter(); - virtual void close(Pool& p); - virtual void flush(Pool& p); - virtual void write(const LogString& str, Pool& p); + void close(Pool& p) override; + void flush(Pool& p) override; + void write(const LogString& str, Pool& p) override; LogString getEncoding() const; OutputStreamPtr getOutputStreamPtr() const; diff --git a/src/main/include/log4cxx/helpers/systemerrwriter.h b/src/main/include/log4cxx/helpers/systemerrwriter.h index 6793b4fad..263043351 100644 --- a/src/main/include/log4cxx/helpers/systemerrwriter.h +++ b/src/main/include/log4cxx/helpers/systemerrwriter.h @@ -40,9 +40,9 @@ class LOG4CXX_EXPORT SystemErrWriter : public Writer SystemErrWriter(); virtual ~SystemErrWriter(); - virtual void close(Pool& p); - virtual void flush(Pool& p); - virtual void write(const LogString& str, Pool& p); + void close(Pool& p) override; + void flush(Pool& p) override; + void write(const LogString& str, Pool& p) override; static void write(const LogString& str); static void flush(); diff --git a/src/main/include/log4cxx/helpers/systemoutwriter.h b/src/main/include/log4cxx/helpers/systemoutwriter.h index 642e039ec..9b3d207ed 100644 --- a/src/main/include/log4cxx/helpers/systemoutwriter.h +++ b/src/main/include/log4cxx/helpers/systemoutwriter.h @@ -40,9 +40,9 @@ class LOG4CXX_EXPORT SystemOutWriter : public Writer SystemOutWriter(); ~SystemOutWriter(); - virtual void close(Pool& p); - virtual void flush(Pool& p); - virtual void write(const LogString& str, Pool& p); + void close(Pool& p) override; + void flush(Pool& p) override; + void write(const LogString& str, Pool& p) override; static void write(const LogString& str); static void flush(); diff --git a/src/main/include/log4cxx/htmllayout.h b/src/main/include/log4cxx/htmllayout.h index 30b1fca66..2a83c0010 100644 --- a/src/main/include/log4cxx/htmllayout.h +++ b/src/main/include/log4cxx/htmllayout.h @@ -76,7 +76,7 @@ class LOG4CXX_EXPORT HTMLLayout : public Layout /** Returns the content type output by this layout, i.e "text/html". */ - virtual LogString getContentType() const; + LogString getContentType() const override; /** No options to activate. @@ -86,25 +86,25 @@ class LOG4CXX_EXPORT HTMLLayout : public Layout /** Set options */ - virtual void setOption(const LogString& option, const LogString& value) override; + void setOption(const LogString& option, const LogString& value) override; - virtual void format(LogString& output, - const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool) const; + void format(LogString& output, + const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool) const override; /** Append appropriate HTML headers. */ - virtual void appendHeader(LogString& output, log4cxx::helpers::Pool& pool); + void appendHeader(LogString& output, log4cxx::helpers::Pool& pool) override; /** Append the appropriate HTML footers. */ - virtual void appendFooter(LogString& output, log4cxx::helpers::Pool& pool); + void appendFooter(LogString& output, log4cxx::helpers::Pool& pool) override; /** The HTML layout handles the throwable contained in logging events. Hence, this method return false. */ - bool ignoresThrowable() const; + bool ignoresThrowable() const override; }; // class HtmlLayout LOG4CXX_PTR_DEF(HTMLLayout); diff --git a/src/main/include/log4cxx/jsonlayout.h b/src/main/include/log4cxx/jsonlayout.h index 5db72fd6e..7edfaad1d 100644 --- a/src/main/include/log4cxx/jsonlayout.h +++ b/src/main/include/log4cxx/jsonlayout.h @@ -109,7 +109,7 @@ class LOG4CXX_EXPORT JSONLayout : public Layout /** Returns the content type output by this layout, i.e "application/json". */ - virtual LogString getContentType() const + LogString getContentType() const override { return LOG4CXX_STR("application/json"); } @@ -122,15 +122,15 @@ class LOG4CXX_EXPORT JSONLayout : public Layout /** Set options */ - virtual void setOption(const LogString& option, const LogString& value) override; + void setOption(const LogString& option, const LogString& value) override; - virtual void format(LogString& output, - const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool) const; + void format(LogString& output, + const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool) const override; /** The JSON layout handles the throwable contained in logging events. Hence, this method return false. */ - virtual bool ignoresThrowable() const + bool ignoresThrowable() const override { return false; } diff --git a/src/main/include/log4cxx/net/xmlsocketappender.h b/src/main/include/log4cxx/net/xmlsocketappender.h index dad19f72a..fe4b63d3a 100644 --- a/src/main/include/log4cxx/net/xmlsocketappender.h +++ b/src/main/include/log4cxx/net/xmlsocketappender.h @@ -124,15 +124,15 @@ class LOG4CXX_EXPORT XMLSocketAppender : public SocketAppenderSkeleton protected: - virtual void setSocket(log4cxx::helpers::SocketPtr& socket, log4cxx::helpers::Pool& p); + void setSocket(log4cxx::helpers::SocketPtr& socket, log4cxx::helpers::Pool& p) override; - virtual void cleanUp(log4cxx::helpers::Pool& p); + void cleanUp(log4cxx::helpers::Pool& p) override; - virtual int getDefaultDelay() const; + int getDefaultDelay() const override; - virtual int getDefaultPort() const; + int getDefaultPort() const override; - void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool); + void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool) override; private: // prevent copy and assignment statements diff --git a/src/main/include/log4cxx/pattern/classnamepatternconverter.h b/src/main/include/log4cxx/pattern/classnamepatternconverter.h index 66ce9f91d..44fc0efa1 100644 --- a/src/main/include/log4cxx/pattern/classnamepatternconverter.h +++ b/src/main/include/log4cxx/pattern/classnamepatternconverter.h @@ -60,7 +60,7 @@ class LOG4CXX_EXPORT ClassNamePatternConverter : public NamePatternConverter void format(const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; }; } diff --git a/src/main/include/log4cxx/pattern/colorendpatternconverter.h b/src/main/include/log4cxx/pattern/colorendpatternconverter.h index fbdae3cb3..07317b5e1 100644 --- a/src/main/include/log4cxx/pattern/colorendpatternconverter.h +++ b/src/main/include/log4cxx/pattern/colorendpatternconverter.h @@ -56,7 +56,7 @@ class LOG4CXX_EXPORT ColorEndPatternConverter void format(const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; }; } diff --git a/src/main/include/log4cxx/pattern/colorstartpatternconverter.h b/src/main/include/log4cxx/pattern/colorstartpatternconverter.h index fc45befdc..837266046 100644 --- a/src/main/include/log4cxx/pattern/colorstartpatternconverter.h +++ b/src/main/include/log4cxx/pattern/colorstartpatternconverter.h @@ -57,7 +57,7 @@ class LOG4CXX_EXPORT ColorStartPatternConverter void format(const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; }; } diff --git a/src/main/include/log4cxx/pattern/datepatternconverter.h b/src/main/include/log4cxx/pattern/datepatternconverter.h index 229c8db6b..aae4ecefe 100644 --- a/src/main/include/log4cxx/pattern/datepatternconverter.h +++ b/src/main/include/log4cxx/pattern/datepatternconverter.h @@ -65,7 +65,7 @@ class LOG4CXX_EXPORT DatePatternConverter : public LoggingEventPatternConverter void format(const log4cxx::spi::LoggingEventPtr& event, LogString& output, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; void format(const log4cxx::helpers::ObjectPtr& obj, LogString& output, log4cxx::helpers::Pool& p) const; diff --git a/src/main/include/log4cxx/pattern/filelocationpatternconverter.h b/src/main/include/log4cxx/pattern/filelocationpatternconverter.h index d94d61eb0..c133885c7 100644 --- a/src/main/include/log4cxx/pattern/filelocationpatternconverter.h +++ b/src/main/include/log4cxx/pattern/filelocationpatternconverter.h @@ -56,7 +56,7 @@ class LOG4CXX_EXPORT FileLocationPatternConverter void format(const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; }; } diff --git a/src/main/include/log4cxx/pattern/fulllocationpatternconverter.h b/src/main/include/log4cxx/pattern/fulllocationpatternconverter.h index d5b6cae5d..3e4d95921 100644 --- a/src/main/include/log4cxx/pattern/fulllocationpatternconverter.h +++ b/src/main/include/log4cxx/pattern/fulllocationpatternconverter.h @@ -56,7 +56,7 @@ class LOG4CXX_EXPORT FullLocationPatternConverter void format(const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; }; } diff --git a/src/main/include/log4cxx/pattern/levelpatternconverter.h b/src/main/include/log4cxx/pattern/levelpatternconverter.h index 3ae0c7b0b..c19a9d08f 100644 --- a/src/main/include/log4cxx/pattern/levelpatternconverter.h +++ b/src/main/include/log4cxx/pattern/levelpatternconverter.h @@ -55,7 +55,7 @@ class LOG4CXX_EXPORT LevelPatternConverter : public LoggingEventPatternConverter void format(const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; LogString getStyleClass(const log4cxx::helpers::ObjectPtr& e) const; }; diff --git a/src/main/include/log4cxx/pattern/linelocationpatternconverter.h b/src/main/include/log4cxx/pattern/linelocationpatternconverter.h index 5656c4861..b025ddd7d 100644 --- a/src/main/include/log4cxx/pattern/linelocationpatternconverter.h +++ b/src/main/include/log4cxx/pattern/linelocationpatternconverter.h @@ -56,7 +56,7 @@ class LOG4CXX_EXPORT LineLocationPatternConverter void format(const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; }; } diff --git a/src/main/include/log4cxx/pattern/lineseparatorpatternconverter.h b/src/main/include/log4cxx/pattern/lineseparatorpatternconverter.h index 592f708d4..50d4db146 100644 --- a/src/main/include/log4cxx/pattern/lineseparatorpatternconverter.h +++ b/src/main/include/log4cxx/pattern/lineseparatorpatternconverter.h @@ -56,7 +56,7 @@ class LOG4CXX_EXPORT LineSeparatorPatternConverter void format(const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; void format(const log4cxx::helpers::ObjectPtr& obj, LogString& toAppendTo, diff --git a/src/main/include/log4cxx/pattern/literalpatternconverter.h b/src/main/include/log4cxx/pattern/literalpatternconverter.h index d07a8c65b..f38a612a9 100644 --- a/src/main/include/log4cxx/pattern/literalpatternconverter.h +++ b/src/main/include/log4cxx/pattern/literalpatternconverter.h @@ -56,7 +56,7 @@ class LOG4CXX_EXPORT LiteralPatternConverter : public LoggingEventPatternConvert void format(const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; void format(const log4cxx::helpers::ObjectPtr& obj, LogString& toAppendTo, diff --git a/src/main/include/log4cxx/pattern/loggerpatternconverter.h b/src/main/include/log4cxx/pattern/loggerpatternconverter.h index 4ff2f1a66..e492c51b9 100644 --- a/src/main/include/log4cxx/pattern/loggerpatternconverter.h +++ b/src/main/include/log4cxx/pattern/loggerpatternconverter.h @@ -56,7 +56,7 @@ class LOG4CXX_EXPORT LoggerPatternConverter : public NamePatternConverter void format(const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; }; } diff --git a/src/main/include/log4cxx/pattern/loggingeventpatternconverter.h b/src/main/include/log4cxx/pattern/loggingeventpatternconverter.h index 667c78d79..07a65a773 100644 --- a/src/main/include/log4cxx/pattern/loggingeventpatternconverter.h +++ b/src/main/include/log4cxx/pattern/loggingeventpatternconverter.h @@ -67,7 +67,7 @@ class LOG4CXX_EXPORT LoggingEventPatternConverter : public PatternConverter void format(const log4cxx::helpers::ObjectPtr& obj, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; /** * Normally pattern converters are not meant to handle Exceptions although diff --git a/src/main/include/log4cxx/pattern/messagepatternconverter.h b/src/main/include/log4cxx/pattern/messagepatternconverter.h index 5522cc9c6..07868e527 100644 --- a/src/main/include/log4cxx/pattern/messagepatternconverter.h +++ b/src/main/include/log4cxx/pattern/messagepatternconverter.h @@ -55,7 +55,7 @@ class LOG4CXX_EXPORT MessagePatternConverter : public LoggingEventPatternConvert void format(const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; }; } } diff --git a/src/main/include/log4cxx/pattern/methodlocationpatternconverter.h b/src/main/include/log4cxx/pattern/methodlocationpatternconverter.h index f0442b3be..a9ff53c37 100644 --- a/src/main/include/log4cxx/pattern/methodlocationpatternconverter.h +++ b/src/main/include/log4cxx/pattern/methodlocationpatternconverter.h @@ -56,7 +56,7 @@ class LOG4CXX_EXPORT MethodLocationPatternConverter void format(const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; }; } } diff --git a/src/main/include/log4cxx/pattern/ndcpatternconverter.h b/src/main/include/log4cxx/pattern/ndcpatternconverter.h index 6713d5c70..c06faa702 100644 --- a/src/main/include/log4cxx/pattern/ndcpatternconverter.h +++ b/src/main/include/log4cxx/pattern/ndcpatternconverter.h @@ -55,7 +55,7 @@ class LOG4CXX_EXPORT NDCPatternConverter : public LoggingEventPatternConverter void format(const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; }; } } diff --git a/src/main/include/log4cxx/pattern/shortfilelocationpatternconverter.h b/src/main/include/log4cxx/pattern/shortfilelocationpatternconverter.h index db17d0bfd..98456b11f 100644 --- a/src/main/include/log4cxx/pattern/shortfilelocationpatternconverter.h +++ b/src/main/include/log4cxx/pattern/shortfilelocationpatternconverter.h @@ -59,7 +59,7 @@ class LOG4CXX_EXPORT ShortFileLocationPatternConverter void format(const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; }; } diff --git a/src/main/include/log4cxx/pattern/threadpatternconverter.h b/src/main/include/log4cxx/pattern/threadpatternconverter.h index fe362f025..dad74180e 100644 --- a/src/main/include/log4cxx/pattern/threadpatternconverter.h +++ b/src/main/include/log4cxx/pattern/threadpatternconverter.h @@ -55,7 +55,7 @@ class LOG4CXX_EXPORT ThreadPatternConverter : public LoggingEventPatternConverte void format(const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; }; } } diff --git a/src/main/include/log4cxx/pattern/throwableinformationpatternconverter.h b/src/main/include/log4cxx/pattern/throwableinformationpatternconverter.h index 83c194043..1a07ca300 100644 --- a/src/main/include/log4cxx/pattern/throwableinformationpatternconverter.h +++ b/src/main/include/log4cxx/pattern/throwableinformationpatternconverter.h @@ -61,7 +61,7 @@ class LOG4CXX_EXPORT ThrowableInformationPatternConverter void format(const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; /** * This converter obviously handles throwables. diff --git a/src/main/include/log4cxx/patternlayout.h b/src/main/include/log4cxx/patternlayout.h index c8df97502..f98dd4f46 100644 --- a/src/main/include/log4cxx/patternlayout.h +++ b/src/main/include/log4cxx/patternlayout.h @@ -395,14 +395,14 @@ class LOG4CXX_EXPORT PatternLayout : public Layout */ void activateOptions(log4cxx::helpers::Pool& p) override; - virtual void setOption(const LogString& option, const LogString& value); + void setOption(const LogString& option, const LogString& value) override; /** * The PatternLayout does not handle the throwable contained within * {@link spi::LoggingEvent LoggingEvents}. Thus, it returns * true. */ - virtual bool ignoresThrowable() const + bool ignoresThrowable() const override { return true; } @@ -410,9 +410,9 @@ class LOG4CXX_EXPORT PatternLayout : public Layout /** * Produces a formatted string as specified by the conversion pattern. */ - virtual void format( LogString& output, + void format( LogString& output, const spi::LoggingEventPtr& event, - log4cxx::helpers::Pool& pool) const; + log4cxx::helpers::Pool& pool) const override; protected: virtual log4cxx::pattern::PatternMap getFormatSpecifiers(); diff --git a/src/main/include/log4cxx/simplelayout.h b/src/main/include/log4cxx/simplelayout.h index 421e08367..6d2bf6c86 100644 --- a/src/main/include/log4cxx/simplelayout.h +++ b/src/main/include/log4cxx/simplelayout.h @@ -57,23 +57,23 @@ class LOG4CXX_EXPORT SimpleLayout : public Layout @return A byte array in SimpleLayout format. */ - virtual void format(LogString& output, + void format(LogString& output, const spi::LoggingEventPtr& event, - log4cxx::helpers::Pool& pool) const; + log4cxx::helpers::Pool& pool) const override; /** The SimpleLayout does not handle the throwable contained within {@link spi::LoggingEvent LoggingEvents}. Thus, it returns true. */ - bool ignoresThrowable() const + bool ignoresThrowable() const override { return true; } void activateOptions(log4cxx::helpers::Pool& /* p */) override {} void setOption(const LogString& /* option */, - const LogString& /* value */) {} + const LogString& /* value */) override {} }; LOG4CXX_PTR_DEF(SimpleLayout); } // namespace log4cxx diff --git a/src/main/include/log4cxx/xml/xmllayout.h b/src/main/include/log4cxx/xml/xmllayout.h index 96846e71f..a51fee4b5 100644 --- a/src/main/include/log4cxx/xml/xmllayout.h +++ b/src/main/include/log4cxx/xml/xmllayout.h @@ -99,27 +99,27 @@ class LOG4CXX_EXPORT XMLLayout : public Layout /** No options to activate. */ - void activateOptions(log4cxx::helpers::Pool& /* p */) { } + void activateOptions(log4cxx::helpers::Pool& /* p */) override { } /** Set options */ void setOption(const LogString& option, - const LogString& value); + const LogString& value) override; /** * Formats a {@link spi::LoggingEvent LoggingEvent} * in conformance with the log4cxx.dtd. **/ - virtual void format(LogString& output, + void format(LogString& output, const spi::LoggingEventPtr& event, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; /** The XMLLayout prints and does not ignore exceptions. Hence the return value false. */ - virtual bool ignoresThrowable() const + bool ignoresThrowable() const override { return false; } From 91814b1ed0c8fd7a732de7302710197fb810a64a Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sun, 13 Nov 2022 13:02:23 +1100 Subject: [PATCH 09/17] Prevent Clang warning messages --- src/main/include/log4cxx/db/odbcappender.h | 2 +- src/main/include/log4cxx/defaultloggerfactory.h | 4 +--- .../include/log4cxx/helpers/bytearrayinputstream.h | 4 ++-- .../include/log4cxx/helpers/bytearrayoutputstream.h | 6 +++--- src/main/include/log4cxx/helpers/fileoutputstream.h | 6 +++--- .../include/log4cxx/helpers/socketoutputstream.h | 6 +++--- src/main/include/log4cxx/nt/nteventlogappender.h | 2 +- .../include/log4cxx/pattern/datepatternconverter.h | 13 +++++++------ .../log4cxx/pattern/integerpatternconverter.h | 4 ++-- .../log4cxx/pattern/literalpatternconverter.h | 6 +++--- .../log4cxx/pattern/loggingeventpatternconverter.h | 6 +++--- src/main/include/log4cxx/pattern/patternconverter.h | 8 ++++---- src/main/include/log4cxx/propertyconfigurator.h | 2 +- .../log4cxx/rolling/filterbasedtriggeringpolicy.h | 4 ++-- .../log4cxx/rolling/fixedwindowrollingpolicy.h | 6 +++--- .../log4cxx/rolling/manualtriggeringpolicy.h | 4 ++-- .../rolling/multiprocessrollingfileappender.h | 6 +++--- .../include/log4cxx/rolling/rollingfileappender.h | 4 ++-- .../log4cxx/rolling/sizebasedtriggeringpolicy.h | 4 ++-- .../log4cxx/rolling/timebasedrollingpolicy.h | 10 +++++----- src/main/include/log4cxx/spi/loggerfactory.h | 4 +--- src/main/include/log4cxx/writerappender.h | 3 +-- src/main/include/log4cxx/xml/domconfigurator.h | 2 +- 23 files changed, 56 insertions(+), 60 deletions(-) diff --git a/src/main/include/log4cxx/db/odbcappender.h b/src/main/include/log4cxx/db/odbcappender.h index 25aff4994..cf8dfee21 100644 --- a/src/main/include/log4cxx/db/odbcappender.h +++ b/src/main/include/log4cxx/db/odbcappender.h @@ -126,7 +126,7 @@ class LOG4CXX_EXPORT ODBCAppender : public AppenderSkeleton /** * Adds the event to the buffer. When full the buffer is flushed. */ - void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool&); + void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool&) override; /** * By default getLogStatement sends the event to the required Layout object. diff --git a/src/main/include/log4cxx/defaultloggerfactory.h b/src/main/include/log4cxx/defaultloggerfactory.h index 9bb7ac87e..a5ce85a5c 100644 --- a/src/main/include/log4cxx/defaultloggerfactory.h +++ b/src/main/include/log4cxx/defaultloggerfactory.h @@ -36,9 +36,7 @@ class LOG4CXX_EXPORT DefaultLoggerFactory : LOG4CXX_CAST_ENTRY(spi::LoggerFactory) END_LOG4CXX_CAST_MAP() - virtual LoggerPtr makeNewLoggerInstance( - log4cxx::helpers::Pool& pool, - const LogString& name) const; + LoggerPtr makeNewLoggerInstance(helpers::Pool& pool, const LogString& name) const override; }; } // namespace log4cxx diff --git a/src/main/include/log4cxx/helpers/bytearrayinputstream.h b/src/main/include/log4cxx/helpers/bytearrayinputstream.h index ecacecef7..5b15f4580 100644 --- a/src/main/include/log4cxx/helpers/bytearrayinputstream.h +++ b/src/main/include/log4cxx/helpers/bytearrayinputstream.h @@ -57,7 +57,7 @@ class LOG4CXX_EXPORT ByteArrayInputStream : public InputStream * Closes this file input stream and releases any system * resources associated with the stream. */ - virtual void close(); + void close() override; /** * Reads a sequence of bytes into the given buffer. @@ -66,7 +66,7 @@ class LOG4CXX_EXPORT ByteArrayInputStream : public InputStream * @return the total number of bytes read into the buffer, or -1 if there * is no more data because the end of the stream has been reached. */ - virtual int read(ByteBuffer& buf); + int read(ByteBuffer& buf) override; private: diff --git a/src/main/include/log4cxx/helpers/bytearrayoutputstream.h b/src/main/include/log4cxx/helpers/bytearrayoutputstream.h index 56f0c8bf8..3d6089b95 100644 --- a/src/main/include/log4cxx/helpers/bytearrayoutputstream.h +++ b/src/main/include/log4cxx/helpers/bytearrayoutputstream.h @@ -48,9 +48,9 @@ class LOG4CXX_EXPORT ByteArrayOutputStream : public OutputStream ByteArrayOutputStream(); virtual ~ByteArrayOutputStream(); - virtual void close(Pool& p); - virtual void flush(Pool& p); - virtual void write(ByteBuffer& buf, Pool& p); + void close(Pool& p) override; + void flush(Pool& p) override; + void write(ByteBuffer& buf, Pool& p) override; ByteList toByteArray() const; private: diff --git a/src/main/include/log4cxx/helpers/fileoutputstream.h b/src/main/include/log4cxx/helpers/fileoutputstream.h index baacb2ba9..352e632bc 100644 --- a/src/main/include/log4cxx/helpers/fileoutputstream.h +++ b/src/main/include/log4cxx/helpers/fileoutputstream.h @@ -48,9 +48,9 @@ class LOG4CXX_EXPORT FileOutputStream : public OutputStream FileOutputStream(const logchar* filename, bool append = false); virtual ~FileOutputStream(); - virtual void close(Pool& p); - virtual void flush(Pool& p); - virtual void write(ByteBuffer& buf, Pool& p); + void close(Pool& p) override; + void flush(Pool& p) override; + void write(ByteBuffer& buf, Pool& p) override; apr_file_t* getFilePtr() const; diff --git a/src/main/include/log4cxx/helpers/socketoutputstream.h b/src/main/include/log4cxx/helpers/socketoutputstream.h index b2750869f..fce751be2 100644 --- a/src/main/include/log4cxx/helpers/socketoutputstream.h +++ b/src/main/include/log4cxx/helpers/socketoutputstream.h @@ -40,9 +40,9 @@ class LOG4CXX_EXPORT SocketOutputStream : public OutputStream SocketOutputStream(const SocketPtr& socket); ~SocketOutputStream(); - virtual void close(Pool& p); - virtual void flush(Pool& p); - virtual void write(ByteBuffer& buf, Pool& p); + void close(Pool& p) override; + void flush(Pool& p) override; + void write(ByteBuffer& buf, Pool& p) override; private: LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(SocketOutputStreamPrivate, m_priv) diff --git a/src/main/include/log4cxx/nt/nteventlogappender.h b/src/main/include/log4cxx/nt/nteventlogappender.h index 097cf9c3b..a3a927248 100644 --- a/src/main/include/log4cxx/nt/nteventlogappender.h +++ b/src/main/include/log4cxx/nt/nteventlogappender.h @@ -83,7 +83,7 @@ class LOG4CXX_EXPORT NTEventLogAppender : public AppenderSkeleton typedef void SID; typedef void* HANDLE; - virtual void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p); + void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; static unsigned short getEventType(const spi::LoggingEventPtr& event); static unsigned short getEventCategory(const spi::LoggingEventPtr& event); /* diff --git a/src/main/include/log4cxx/pattern/datepatternconverter.h b/src/main/include/log4cxx/pattern/datepatternconverter.h index aae4ecefe..66ea38aca 100644 --- a/src/main/include/log4cxx/pattern/datepatternconverter.h +++ b/src/main/include/log4cxx/pattern/datepatternconverter.h @@ -44,7 +44,7 @@ class LOG4CXX_EXPORT DatePatternConverter : public LoggingEventPatternConverter * @param options options, may be null. * @return instance of pattern converter. */ - static log4cxx::helpers::DateFormatPtr getDateFormat(const OptionsList& options); + static helpers::DateFormatPtr getDateFormat(const OptionsList& options); public: DECLARE_LOG4CXX_PATTERN(DatePatternConverter) BEGIN_LOG4CXX_CAST_MAP() @@ -63,16 +63,17 @@ class LOG4CXX_EXPORT DatePatternConverter : public LoggingEventPatternConverter using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& output, helpers::Pool& p) const override; - void format(const log4cxx::helpers::ObjectPtr& obj, + + void format(const helpers::ObjectPtr& obj, LogString& output, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; - void format(const log4cxx::helpers::DatePtr& date, + void format(const helpers::DatePtr& date, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const; }; LOG4CXX_PTR_DEF(DatePatternConverter); diff --git a/src/main/include/log4cxx/pattern/integerpatternconverter.h b/src/main/include/log4cxx/pattern/integerpatternconverter.h index 961148d31..b407b275a 100644 --- a/src/main/include/log4cxx/pattern/integerpatternconverter.h +++ b/src/main/include/log4cxx/pattern/integerpatternconverter.h @@ -51,9 +51,9 @@ class LOG4CXX_EXPORT IntegerPatternConverter : public PatternConverter static PatternConverterPtr newInstance( const std::vector& options); - void format(const log4cxx::helpers::ObjectPtr& obj, + void format(const helpers::ObjectPtr& obj, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; }; LOG4CXX_PTR_DEF(IntegerPatternConverter); diff --git a/src/main/include/log4cxx/pattern/literalpatternconverter.h b/src/main/include/log4cxx/pattern/literalpatternconverter.h index f38a612a9..b582bdbd1 100644 --- a/src/main/include/log4cxx/pattern/literalpatternconverter.h +++ b/src/main/include/log4cxx/pattern/literalpatternconverter.h @@ -54,13 +54,13 @@ class LOG4CXX_EXPORT LiteralPatternConverter : public LoggingEventPatternConvert using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p) const override; - void format(const log4cxx::helpers::ObjectPtr& obj, + void format(const helpers::ObjectPtr& obj, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; }; } diff --git a/src/main/include/log4cxx/pattern/loggingeventpatternconverter.h b/src/main/include/log4cxx/pattern/loggingeventpatternconverter.h index 07a65a773..c76169508 100644 --- a/src/main/include/log4cxx/pattern/loggingeventpatternconverter.h +++ b/src/main/include/log4cxx/pattern/loggingeventpatternconverter.h @@ -61,11 +61,11 @@ class LOG4CXX_EXPORT LoggingEventPatternConverter : public PatternConverter * @param p pool for memory allocations needing during format. */ virtual void format( - const log4cxx::spi::LoggingEventPtr& event, + const spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const = 0; + helpers::Pool& p) const = 0; - void format(const log4cxx::helpers::ObjectPtr& obj, + void format(const helpers::ObjectPtr& obj, LogString& toAppendTo, helpers::Pool& p) const override; diff --git a/src/main/include/log4cxx/pattern/patternconverter.h b/src/main/include/log4cxx/pattern/patternconverter.h index 05916f45e..9d63a37a4 100644 --- a/src/main/include/log4cxx/pattern/patternconverter.h +++ b/src/main/include/log4cxx/pattern/patternconverter.h @@ -42,7 +42,7 @@ typedef std::vector OptionsList; converting an object in a converter specific manner. */ -class LOG4CXX_EXPORT PatternConverter : public virtual log4cxx::helpers::Object +class LOG4CXX_EXPORT PatternConverter : public virtual helpers::Object { protected: LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(PatternConverterPrivate, m_priv) @@ -71,9 +71,9 @@ class LOG4CXX_EXPORT PatternConverter : public virtual log4cxx::helpers::Object * @param toAppendTo string buffer to which the formatted event will be appended. May not be null. * @param p pool for any allocations necessary during formatting. */ - virtual void format(const log4cxx::helpers::ObjectPtr& obj, + virtual void format(const helpers::ObjectPtr& obj, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const = 0; + helpers::Pool& p) const = 0; /** * This method returns the name of the conversion pattern. @@ -93,7 +93,7 @@ class LOG4CXX_EXPORT PatternConverter : public virtual log4cxx::helpers::Object * @param e null values are accepted * @return the name of the conversion pattern */ - virtual LogString getStyleClass(const log4cxx::helpers::ObjectPtr& e) const; + virtual LogString getStyleClass(const helpers::ObjectPtr& e) const; protected: /** diff --git a/src/main/include/log4cxx/propertyconfigurator.h b/src/main/include/log4cxx/propertyconfigurator.h index 9eeda9793..4cdfc3db8 100644 --- a/src/main/include/log4cxx/propertyconfigurator.h +++ b/src/main/include/log4cxx/propertyconfigurator.h @@ -290,7 +290,7 @@ class LOG4CXX_EXPORT PropertyConfigurator : @param hierarchy The hierarchy to operation upon. */ void doConfigure(const File& configFileName, - spi::LoggerRepositoryPtr hierarchy); + spi::LoggerRepositoryPtr hierarchy) override; /** Read configuration options from file configFilename. diff --git a/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h b/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h index 7e732c256..ad94451aa 100644 --- a/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h +++ b/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h @@ -84,11 +84,11 @@ class LOG4CXX_EXPORT FilterBasedTriggeringPolicy : public TriggeringPolicy * @param fileLength Length of the file in bytes. * @return true if a rollover should occur. */ - virtual bool isTriggeringEvent( + bool isTriggeringEvent( Appender* appender, const log4cxx::spi::LoggingEventPtr& event, const LogString& filename, - size_t fileLength); + size_t fileLength) override; /** * Add a filter to end of the filter list. diff --git a/src/main/include/log4cxx/rolling/fixedwindowrollingpolicy.h b/src/main/include/log4cxx/rolling/fixedwindowrollingpolicy.h index a269d474e..4bc210dae 100644 --- a/src/main/include/log4cxx/rolling/fixedwindowrollingpolicy.h +++ b/src/main/include/log4cxx/rolling/fixedwindowrollingpolicy.h @@ -108,7 +108,7 @@ class LOG4CXX_EXPORT FixedWindowRollingPolicy : public RollingPolicyBase RolloverDescriptionPtr initialize( const LogString& currentActiveFile, const bool append, - log4cxx::helpers::Pool& pool); + log4cxx::helpers::Pool& pool) override; /** * {@inheritDoc} @@ -116,10 +116,10 @@ class LOG4CXX_EXPORT FixedWindowRollingPolicy : public RollingPolicyBase RolloverDescriptionPtr rollover( const LogString& currentActiveFile, const bool append, - log4cxx::helpers::Pool& pool); + log4cxx::helpers::Pool& pool) override; protected: - log4cxx::pattern::PatternMap getFormatSpecifiers() const; + log4cxx::pattern::PatternMap getFormatSpecifiers() const override; }; diff --git a/src/main/include/log4cxx/rolling/manualtriggeringpolicy.h b/src/main/include/log4cxx/rolling/manualtriggeringpolicy.h index 54224db7e..c7a123e3e 100644 --- a/src/main/include/log4cxx/rolling/manualtriggeringpolicy.h +++ b/src/main/include/log4cxx/rolling/manualtriggeringpolicy.h @@ -61,11 +61,11 @@ class LOG4CXX_EXPORT ManualTriggeringPolicy : public TriggeringPolicy * @param fileLength Length of the file in bytes. * @return true if a rollover should occur. */ - virtual bool isTriggeringEvent( + bool isTriggeringEvent( Appender* appender, const log4cxx::spi::LoggingEventPtr& event, const LogString& filename, - size_t fileLength); + size_t fileLength) override; void activateOptions(log4cxx::helpers::Pool&) override; void setOption(const LogString& option, const LogString& value) override; diff --git a/src/main/include/log4cxx/rolling/multiprocessrollingfileappender.h b/src/main/include/log4cxx/rolling/multiprocessrollingfileappender.h index 237f63477..3b9477353 100644 --- a/src/main/include/log4cxx/rolling/multiprocessrollingfileappender.h +++ b/src/main/include/log4cxx/rolling/multiprocessrollingfileappender.h @@ -64,14 +64,14 @@ class LOG4CXX_EXPORT MultiprocessRollingFileAppender : public FileAppender File is truncated with no backup files created. */ - bool rollover(log4cxx::helpers::Pool& p); + bool rollover(log4cxx::helpers::Pool& p) override; protected: /** Actual writing occurs here. */ - virtual void subAppend(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p); + void subAppend(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; bool rolloverInternal(log4cxx::helpers::Pool& p); @@ -107,7 +107,7 @@ class LOG4CXX_EXPORT MultiprocessRollingFileAppender : public FileAppender @param os output stream, may not be null. @return new writer. */ - log4cxx::helpers::WriterPtr createWriter(log4cxx::helpers::OutputStreamPtr& os); + helpers::WriterPtr createWriter(helpers::OutputStreamPtr& os) override; public: /** diff --git a/src/main/include/log4cxx/rolling/rollingfileappender.h b/src/main/include/log4cxx/rolling/rollingfileappender.h index fcc8609dc..3d299f75a 100644 --- a/src/main/include/log4cxx/rolling/rollingfileappender.h +++ b/src/main/include/log4cxx/rolling/rollingfileappender.h @@ -153,7 +153,7 @@ class LOG4CXX_EXPORT RollingFileAppender : public FileAppender /** Actual writing occurs here. */ - virtual void subAppend(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p); + void subAppend(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; bool rolloverInternal(log4cxx::helpers::Pool& p); @@ -189,7 +189,7 @@ class LOG4CXX_EXPORT RollingFileAppender : public FileAppender @param os output stream, may not be null. @return new writer. */ - log4cxx::helpers::WriterPtr createWriter(log4cxx::helpers::OutputStreamPtr& os); + helpers::WriterPtr createWriter(helpers::OutputStreamPtr& os) override; public: /** diff --git a/src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h b/src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h index af08145e5..9f0ce8596 100644 --- a/src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h +++ b/src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h @@ -64,11 +64,11 @@ class LOG4CXX_EXPORT SizeBasedTriggeringPolicy : public TriggeringPolicy * @param fileLength Length of the file in bytes. * @return true if a rollover should occur. */ - virtual bool isTriggeringEvent( + bool isTriggeringEvent( Appender* appender, const log4cxx::spi::LoggingEventPtr& event, const LogString& filename, - size_t fileLength); + size_t fileLength) override; size_t getMaxFileSize(); diff --git a/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h b/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h index 429f8a0fc..459ff61ed 100755 --- a/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h +++ b/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h @@ -168,7 +168,7 @@ class LOG4CXX_EXPORT TimeBasedRollingPolicy : public RollingPolicyBase, RolloverDescriptionPtr initialize( const LogString& currentActiveFile, const bool append, - log4cxx::helpers::Pool& pool); + log4cxx::helpers::Pool& pool) override; /** * {@inheritDoc} @@ -176,7 +176,7 @@ class LOG4CXX_EXPORT TimeBasedRollingPolicy : public RollingPolicyBase, RolloverDescriptionPtr rollover( const LogString& currentActiveFile, const bool append, - log4cxx::helpers::Pool& pool); + log4cxx::helpers::Pool& pool) override; /** * Determines if a rollover may be appropriate at this time. If @@ -189,14 +189,14 @@ class LOG4CXX_EXPORT TimeBasedRollingPolicy : public RollingPolicyBase, * @param fileLength Length of the file in bytes. * @return true if a rollover should occur. */ - virtual bool isTriggeringEvent( + bool isTriggeringEvent( Appender* appender, const log4cxx::spi::LoggingEventPtr& event, const LogString& filename, - size_t fileLength); + size_t fileLength) override; protected: - log4cxx::pattern::PatternMap getFormatSpecifiers() const; + log4cxx::pattern::PatternMap getFormatSpecifiers() const override; private: diff --git a/src/main/include/log4cxx/spi/loggerfactory.h b/src/main/include/log4cxx/spi/loggerfactory.h index 846c69b89..9d4809465 100644 --- a/src/main/include/log4cxx/spi/loggerfactory.h +++ b/src/main/include/log4cxx/spi/loggerfactory.h @@ -34,9 +34,7 @@ class LOG4CXX_EXPORT LoggerFactory : public virtual helpers::Object public: DECLARE_ABSTRACT_LOG4CXX_OBJECT(LoggerFactory) virtual ~LoggerFactory() {} - virtual LoggerPtr makeNewLoggerInstance( - log4cxx::helpers::Pool& pool, - const LogString& name) const = 0; + virtual LoggerPtr makeNewLoggerInstance(helpers::Pool& pool, const LogString& name) const = 0; }; diff --git a/src/main/include/log4cxx/writerappender.h b/src/main/include/log4cxx/writerappender.h index 56c687d7a..08ce9fc29 100644 --- a/src/main/include/log4cxx/writerappender.h +++ b/src/main/include/log4cxx/writerappender.h @@ -134,8 +134,7 @@ class LOG4CXX_EXPORT WriterAppender : public AppenderSkeleton encoding property. If the encoding value is specified incorrectly the writer will be opened using the default system encoding (an error message will be printed to the loglog. */ - virtual log4cxx::helpers::WriterPtr createWriter( - log4cxx::helpers::OutputStreamPtr& os); + virtual helpers::WriterPtr createWriter(helpers::OutputStreamPtr& os); public: LogString getEncoding() const; diff --git a/src/main/include/log4cxx/xml/domconfigurator.h b/src/main/include/log4cxx/xml/domconfigurator.h index 5c19079e8..7f1bddfc1 100644 --- a/src/main/include/log4cxx/xml/domconfigurator.h +++ b/src/main/include/log4cxx/xml/domconfigurator.h @@ -278,7 +278,7 @@ class LOG4CXX_EXPORT DOMConfigurator : @param repository The hierarchy to operation upon. */ void doConfigure(const File& filename, - spi::LoggerRepositoryPtr repository); + spi::LoggerRepositoryPtr repository) override; protected: static LogString getAttribute( From f5d7983343493fe80c1a68a80bd51b4c600f6c5e Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sun, 13 Nov 2022 13:10:22 +1100 Subject: [PATCH 10/17] Prevent Clang warning messages --- src/main/include/log4cxx/appenderskeleton.h | 4 ++-- src/main/include/log4cxx/asyncappender.h | 4 ++-- src/main/include/log4cxx/consoleappender.h | 2 +- src/main/include/log4cxx/db/odbcappender.h | 4 ++-- src/main/include/log4cxx/fileappender.h | 2 +- src/main/include/log4cxx/filter/expressionfilter.h | 2 +- src/main/include/log4cxx/filter/locationinfofilter.h | 2 +- src/main/include/log4cxx/helpers/onlyonceerrorhandler.h | 2 +- src/main/include/log4cxx/htmllayout.h | 8 ++++---- src/main/include/log4cxx/jsonlayout.h | 4 ++-- src/main/include/log4cxx/net/smtpappender.h | 4 ++-- src/main/include/log4cxx/net/socketappenderskeleton.h | 2 +- src/main/include/log4cxx/net/sockethubappender.h | 4 ++-- src/main/include/log4cxx/net/syslogappender.h | 4 ++-- src/main/include/log4cxx/net/telnetappender.h | 4 ++-- src/main/include/log4cxx/net/xmlsocketappender.h | 6 +++--- src/main/include/log4cxx/nt/nteventlogappender.h | 4 ++-- src/main/include/log4cxx/nt/outputdebugstringappender.h | 2 +- src/main/include/log4cxx/patternlayout.h | 4 ++-- .../include/log4cxx/rolling/filterbasedtriggeringpolicy.h | 2 +- .../include/log4cxx/rolling/fixedwindowrollingpolicy.h | 6 +++--- src/main/include/log4cxx/rolling/manualtriggeringpolicy.h | 2 +- .../log4cxx/rolling/multiprocessrollingfileappender.h | 6 +++--- src/main/include/log4cxx/rolling/rollingfileappender.h | 4 ++-- src/main/include/log4cxx/rolling/rollingpolicybase.h | 2 +- .../include/log4cxx/rolling/sizebasedtriggeringpolicy.h | 2 +- src/main/include/log4cxx/rolling/timebasedrollingpolicy.h | 6 +++--- src/main/include/log4cxx/simplelayout.h | 4 ++-- src/main/include/log4cxx/spi/filter.h | 2 +- src/main/include/log4cxx/spi/optionhandler.h | 2 +- src/main/include/log4cxx/varia/fallbackerrorhandler.h | 2 +- src/main/include/log4cxx/writerappender.h | 4 ++-- src/main/include/log4cxx/xml/xmllayout.h | 2 +- 33 files changed, 57 insertions(+), 57 deletions(-) diff --git a/src/main/include/log4cxx/appenderskeleton.h b/src/main/include/log4cxx/appenderskeleton.h index b0b95b0b2..452815ed8 100644 --- a/src/main/include/log4cxx/appenderskeleton.h +++ b/src/main/include/log4cxx/appenderskeleton.h @@ -74,7 +74,7 @@ class LOG4CXX_EXPORT AppenderSkeleton : Derived appenders should override this method if option structure requires it. */ - virtual void activateOptions(log4cxx::helpers::Pool& /* pool */) override {} + virtual void activateOptions(helpers::Pool& /* pool */) override {} virtual void setOption(const LogString& option, const LogString& value) override; /** @@ -136,7 +136,7 @@ class LOG4CXX_EXPORT AppenderSkeleton : * delegating actual logging to the subclasses specific * AppenderSkeleton#append method. * */ - void doAppend(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool) override; + void doAppend(const spi::LoggingEventPtr& event, helpers::Pool& pool) override; /** Set the {@link spi::ErrorHandler ErrorHandler} for this Appender. diff --git a/src/main/include/log4cxx/asyncappender.h b/src/main/include/log4cxx/asyncappender.h index 9a171e18e..c2404b847 100644 --- a/src/main/include/log4cxx/asyncappender.h +++ b/src/main/include/log4cxx/asyncappender.h @@ -86,9 +86,9 @@ class LOG4CXX_EXPORT AsyncAppender : void addAppender(const AppenderPtr newAppender) override; void doAppend(const spi::LoggingEventPtr& event, - log4cxx::helpers::Pool& pool1) override; + helpers::Pool& pool1) override; - void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; + void append(const spi::LoggingEventPtr& event, helpers::Pool& p) override; /** Close this AsyncAppender by interrupting the diff --git a/src/main/include/log4cxx/consoleappender.h b/src/main/include/log4cxx/consoleappender.h index f47bb95ff..aab1dc336 100644 --- a/src/main/include/log4cxx/consoleappender.h +++ b/src/main/include/log4cxx/consoleappender.h @@ -66,7 +66,7 @@ class LOG4CXX_EXPORT ConsoleAppender : public WriterAppender * */ LogString getTarget() const; - void activateOptions(log4cxx::helpers::Pool& p) override; + void activateOptions(helpers::Pool& p) override; void setOption(const LogString& option, const LogString& value) override; static const LogString& getSystemOut(); static const LogString& getSystemErr(); diff --git a/src/main/include/log4cxx/db/odbcappender.h b/src/main/include/log4cxx/db/odbcappender.h index cf8dfee21..d7f2ce44b 100644 --- a/src/main/include/log4cxx/db/odbcappender.h +++ b/src/main/include/log4cxx/db/odbcappender.h @@ -121,12 +121,12 @@ class LOG4CXX_EXPORT ODBCAppender : public AppenderSkeleton /** Activate the specified options. */ - void activateOptions(log4cxx::helpers::Pool& p) override; + void activateOptions(helpers::Pool& p) override; /** * Adds the event to the buffer. When full the buffer is flushed. */ - void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool&) override; + void append(const spi::LoggingEventPtr& event, helpers::Pool&) override; /** * By default getLogStatement sends the event to the required Layout object. diff --git a/src/main/include/log4cxx/fileappender.h b/src/main/include/log4cxx/fileappender.h index 90489798d..d2e199c01 100644 --- a/src/main/include/log4cxx/fileappender.h +++ b/src/main/include/log4cxx/fileappender.h @@ -117,7 +117,7 @@ class LOG4CXX_EXPORT FileAppender : public WriterAppender

If there was already an opened file, then the previous file is closed first.*/ - void activateOptions(log4cxx::helpers::Pool& p) override; + void activateOptions(helpers::Pool& p) override; void setOption(const LogString& option, const LogString& value) override; /** diff --git a/src/main/include/log4cxx/filter/expressionfilter.h b/src/main/include/log4cxx/filter/expressionfilter.h index baf218853..8eaf84e07 100644 --- a/src/main/include/log4cxx/filter/expressionfilter.h +++ b/src/main/include/log4cxx/filter/expressionfilter.h @@ -100,7 +100,7 @@ class LOG4CXX_EXPORT ExpressionFilter: public log4cxx::spi::Filter ExpressionFilter(); - void activateOptions(log4cxx::helpers::Pool& p) override; + void activateOptions(helpers::Pool& p) override; void setExpression(const LogString& expression); diff --git a/src/main/include/log4cxx/filter/locationinfofilter.h b/src/main/include/log4cxx/filter/locationinfofilter.h index ca72716b9..f4e2953e3 100644 --- a/src/main/include/log4cxx/filter/locationinfofilter.h +++ b/src/main/include/log4cxx/filter/locationinfofilter.h @@ -60,7 +60,7 @@ class LOG4CXX_EXPORT LocationInfoFilter: public log4cxx::spi::Filter LocationInfoFilter(); - void activateOptions(log4cxx::helpers::Pool&) override; + void activateOptions(helpers::Pool&) override; void setExpression(const LogString& expression); diff --git a/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h b/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h index e02ff3b00..0aa74b535 100644 --- a/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h +++ b/src/main/include/log4cxx/helpers/onlyonceerrorhandler.h @@ -67,7 +67,7 @@ class LOG4CXX_EXPORT OnlyOnceErrorHandler : /** No options to activate. */ - void activateOptions(log4cxx::helpers::Pool& p) override; + void activateOptions(helpers::Pool& p) override; void setOption(const LogString& option, const LogString& value) override; diff --git a/src/main/include/log4cxx/htmllayout.h b/src/main/include/log4cxx/htmllayout.h index 2a83c0010..4726fb4a6 100644 --- a/src/main/include/log4cxx/htmllayout.h +++ b/src/main/include/log4cxx/htmllayout.h @@ -81,7 +81,7 @@ class LOG4CXX_EXPORT HTMLLayout : public Layout /** No options to activate. */ - void activateOptions(log4cxx::helpers::Pool& /* p */) override {} + void activateOptions(helpers::Pool& /* p */) override {} /** Set options @@ -89,17 +89,17 @@ class LOG4CXX_EXPORT HTMLLayout : public Layout void setOption(const LogString& option, const LogString& value) override; void format(LogString& output, - const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool) const override; + const spi::LoggingEventPtr& event, helpers::Pool& pool) const override; /** Append appropriate HTML headers. */ - void appendHeader(LogString& output, log4cxx::helpers::Pool& pool) override; + void appendHeader(LogString& output, helpers::Pool& pool) override; /** Append the appropriate HTML footers. */ - void appendFooter(LogString& output, log4cxx::helpers::Pool& pool) override; + void appendFooter(LogString& output, helpers::Pool& pool) override; /** The HTML layout handles the throwable contained in logging diff --git a/src/main/include/log4cxx/jsonlayout.h b/src/main/include/log4cxx/jsonlayout.h index 7edfaad1d..016fe9d0d 100644 --- a/src/main/include/log4cxx/jsonlayout.h +++ b/src/main/include/log4cxx/jsonlayout.h @@ -117,7 +117,7 @@ class LOG4CXX_EXPORT JSONLayout : public Layout /** No options to activate. */ - void activateOptions(log4cxx::helpers::Pool& /* p */) override {} + void activateOptions(helpers::Pool& /* p */) override {} /** Set options @@ -125,7 +125,7 @@ class LOG4CXX_EXPORT JSONLayout : public Layout void setOption(const LogString& option, const LogString& value) override; void format(LogString& output, - const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool) const override; + const spi::LoggingEventPtr& event, helpers::Pool& pool) const override; /** The JSON layout handles the throwable contained in logging diff --git a/src/main/include/log4cxx/net/smtpappender.h b/src/main/include/log4cxx/net/smtpappender.h index a1c03c915..445bc8dbe 100644 --- a/src/main/include/log4cxx/net/smtpappender.h +++ b/src/main/include/log4cxx/net/smtpappender.h @@ -88,13 +88,13 @@ class LOG4CXX_EXPORT SMTPAppender : public AppenderSkeleton Activate the specified options, such as the smtp host, the recipient, from, etc. */ - void activateOptions(log4cxx::helpers::Pool& p) override; + void activateOptions(helpers::Pool& p) override; /** Perform SMTPAppender specific appending actions, mainly adding the event to a cyclic buffer and checking if the event triggers an e-mail to be sent. */ - void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; + void append(const spi::LoggingEventPtr& event, helpers::Pool& p) override; void close() override; diff --git a/src/main/include/log4cxx/net/socketappenderskeleton.h b/src/main/include/log4cxx/net/socketappenderskeleton.h index db0744984..9d511bc5c 100644 --- a/src/main/include/log4cxx/net/socketappenderskeleton.h +++ b/src/main/include/log4cxx/net/socketappenderskeleton.h @@ -55,7 +55,7 @@ class LOG4CXX_EXPORT SocketAppenderSkeleton : public AppenderSkeleton /** Connect to the specified RemoteHost and Port. */ - void activateOptions(log4cxx::helpers::Pool& p) override; + void activateOptions(helpers::Pool& p) override; void close() override; diff --git a/src/main/include/log4cxx/net/sockethubappender.h b/src/main/include/log4cxx/net/sockethubappender.h index 7156ce00d..b79ab3870 100644 --- a/src/main/include/log4cxx/net/sockethubappender.h +++ b/src/main/include/log4cxx/net/sockethubappender.h @@ -132,7 +132,7 @@ class LOG4CXX_EXPORT SocketHubAppender : public AppenderSkeleton /** Set up the socket server on the specified port. */ - void activateOptions(log4cxx::helpers::Pool& p) override; + void activateOptions(helpers::Pool& p) override; /** Set options @@ -143,7 +143,7 @@ class LOG4CXX_EXPORT SocketHubAppender : public AppenderSkeleton /** Append an event to all of current connections. */ - void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; + void append(const spi::LoggingEventPtr& event, helpers::Pool& p) override; /** The SocketHubAppender does not use a layout. Hence, this method returns diff --git a/src/main/include/log4cxx/net/syslogappender.h b/src/main/include/log4cxx/net/syslogappender.h index 62c4ba636..1dff8309f 100644 --- a/src/main/include/log4cxx/net/syslogappender.h +++ b/src/main/include/log4cxx/net/syslogappender.h @@ -78,13 +78,13 @@ class LOG4CXX_EXPORT SyslogAppender : public AppenderSkeleton */ static int getFacility(const LogString& facilityName); - void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; + void append(const spi::LoggingEventPtr& event, helpers::Pool& p) override; /** This method returns immediately as options are activated when they are set. */ - void activateOptions(log4cxx::helpers::Pool& p) override; + void activateOptions(helpers::Pool& p) override; void setOption(const LogString& option, const LogString& value) override; /** diff --git a/src/main/include/log4cxx/net/telnetappender.h b/src/main/include/log4cxx/net/telnetappender.h index 02a423dbd..c5e0812a4 100644 --- a/src/main/include/log4cxx/net/telnetappender.h +++ b/src/main/include/log4cxx/net/telnetappender.h @@ -100,7 +100,7 @@ class LOG4CXX_EXPORT TelnetAppender : public AppenderSkeleton /** all of the options have been set, create the socket handler and wait for connections. */ - void activateOptions(log4cxx::helpers::Pool& p) override; + void activateOptions(helpers::Pool& p) override; /** Set options @@ -125,7 +125,7 @@ class LOG4CXX_EXPORT TelnetAppender : public AppenderSkeleton protected: /** Handles a log event. For this appender, that means writing the message to each connected client. */ - void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; + void append(const spi::LoggingEventPtr& event, helpers::Pool& p) override; //---------------------------------------------------------- SocketHandler: diff --git a/src/main/include/log4cxx/net/xmlsocketappender.h b/src/main/include/log4cxx/net/xmlsocketappender.h index fe4b63d3a..7ca20bb6f 100644 --- a/src/main/include/log4cxx/net/xmlsocketappender.h +++ b/src/main/include/log4cxx/net/xmlsocketappender.h @@ -124,15 +124,15 @@ class LOG4CXX_EXPORT XMLSocketAppender : public SocketAppenderSkeleton protected: - void setSocket(log4cxx::helpers::SocketPtr& socket, log4cxx::helpers::Pool& p) override; + void setSocket(log4cxx::helpers::SocketPtr& socket, helpers::Pool& p) override; - void cleanUp(log4cxx::helpers::Pool& p) override; + void cleanUp(helpers::Pool& p) override; int getDefaultDelay() const override; int getDefaultPort() const override; - void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool) override; + void append(const spi::LoggingEventPtr& event, helpers::Pool& pool) override; private: // prevent copy and assignment statements diff --git a/src/main/include/log4cxx/nt/nteventlogappender.h b/src/main/include/log4cxx/nt/nteventlogappender.h index a3a927248..ab9551c28 100644 --- a/src/main/include/log4cxx/nt/nteventlogappender.h +++ b/src/main/include/log4cxx/nt/nteventlogappender.h @@ -48,7 +48,7 @@ class LOG4CXX_EXPORT NTEventLogAppender : public AppenderSkeleton virtual ~NTEventLogAppender(); - void activateOptions(log4cxx::helpers::Pool& p) override; + void activateOptions(helpers::Pool& p) override; void close() override; void setOption(const LogString& option, const LogString& value) override; @@ -83,7 +83,7 @@ class LOG4CXX_EXPORT NTEventLogAppender : public AppenderSkeleton typedef void SID; typedef void* HANDLE; - void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; + void append(const spi::LoggingEventPtr& event, helpers::Pool& p) override; static unsigned short getEventType(const spi::LoggingEventPtr& event); static unsigned short getEventCategory(const spi::LoggingEventPtr& event); /* diff --git a/src/main/include/log4cxx/nt/outputdebugstringappender.h b/src/main/include/log4cxx/nt/outputdebugstringappender.h index 870e340b7..3c30999be 100644 --- a/src/main/include/log4cxx/nt/outputdebugstringappender.h +++ b/src/main/include/log4cxx/nt/outputdebugstringappender.h @@ -42,7 +42,7 @@ class LOG4CXX_EXPORT OutputDebugStringAppender : public AppenderSkeleton void close() override {} - void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; + void append(const spi::LoggingEventPtr& event, helpers::Pool& p) override; }; } } diff --git a/src/main/include/log4cxx/patternlayout.h b/src/main/include/log4cxx/patternlayout.h index f98dd4f46..f7b844d82 100644 --- a/src/main/include/log4cxx/patternlayout.h +++ b/src/main/include/log4cxx/patternlayout.h @@ -393,7 +393,7 @@ class LOG4CXX_EXPORT PatternLayout : public Layout /** * Call createPatternParser */ - void activateOptions(log4cxx::helpers::Pool& p) override; + void activateOptions(helpers::Pool& p) override; void setOption(const LogString& option, const LogString& value) override; @@ -412,7 +412,7 @@ class LOG4CXX_EXPORT PatternLayout : public Layout */ void format( LogString& output, const spi::LoggingEventPtr& event, - log4cxx::helpers::Pool& pool) const override; + helpers::Pool& pool) const override; protected: virtual log4cxx::pattern::PatternMap getFormatSpecifiers(); diff --git a/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h b/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h index ad94451aa..8d1adfe0d 100644 --- a/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h +++ b/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h @@ -111,7 +111,7 @@ class LOG4CXX_EXPORT FilterBasedTriggeringPolicy : public TriggeringPolicy /** * Prepares the instance for use. */ - void activateOptions(log4cxx::helpers::Pool&) override; + void activateOptions(helpers::Pool&) override; void setOption(const LogString& option, const LogString& value) override; }; diff --git a/src/main/include/log4cxx/rolling/fixedwindowrollingpolicy.h b/src/main/include/log4cxx/rolling/fixedwindowrollingpolicy.h index 4bc210dae..511c32aaf 100644 --- a/src/main/include/log4cxx/rolling/fixedwindowrollingpolicy.h +++ b/src/main/include/log4cxx/rolling/fixedwindowrollingpolicy.h @@ -90,7 +90,7 @@ class LOG4CXX_EXPORT FixedWindowRollingPolicy : public RollingPolicyBase FixedWindowRollingPolicy(); ~FixedWindowRollingPolicy(); - void activateOptions(log4cxx::helpers::Pool& p) override; + void activateOptions(helpers::Pool& p) override; void setOption(const LogString& option, const LogString& value) override; void rollover(); @@ -108,7 +108,7 @@ class LOG4CXX_EXPORT FixedWindowRollingPolicy : public RollingPolicyBase RolloverDescriptionPtr initialize( const LogString& currentActiveFile, const bool append, - log4cxx::helpers::Pool& pool) override; + helpers::Pool& pool) override; /** * {@inheritDoc} @@ -116,7 +116,7 @@ class LOG4CXX_EXPORT FixedWindowRollingPolicy : public RollingPolicyBase RolloverDescriptionPtr rollover( const LogString& currentActiveFile, const bool append, - log4cxx::helpers::Pool& pool) override; + helpers::Pool& pool) override; protected: log4cxx::pattern::PatternMap getFormatSpecifiers() const override; diff --git a/src/main/include/log4cxx/rolling/manualtriggeringpolicy.h b/src/main/include/log4cxx/rolling/manualtriggeringpolicy.h index c7a123e3e..50841bce8 100644 --- a/src/main/include/log4cxx/rolling/manualtriggeringpolicy.h +++ b/src/main/include/log4cxx/rolling/manualtriggeringpolicy.h @@ -67,7 +67,7 @@ class LOG4CXX_EXPORT ManualTriggeringPolicy : public TriggeringPolicy const LogString& filename, size_t fileLength) override; - void activateOptions(log4cxx::helpers::Pool&) override; + void activateOptions(helpers::Pool&) override; void setOption(const LogString& option, const LogString& value) override; }; } diff --git a/src/main/include/log4cxx/rolling/multiprocessrollingfileappender.h b/src/main/include/log4cxx/rolling/multiprocessrollingfileappender.h index 3b9477353..a61795abc 100644 --- a/src/main/include/log4cxx/rolling/multiprocessrollingfileappender.h +++ b/src/main/include/log4cxx/rolling/multiprocessrollingfileappender.h @@ -47,7 +47,7 @@ class LOG4CXX_EXPORT MultiprocessRollingFileAppender : public FileAppender public: MultiprocessRollingFileAppender(); - void activateOptions(log4cxx::helpers::Pool&) override; + void activateOptions(helpers::Pool&) override; /** @@ -64,14 +64,14 @@ class LOG4CXX_EXPORT MultiprocessRollingFileAppender : public FileAppender File is truncated with no backup files created. */ - bool rollover(log4cxx::helpers::Pool& p) override; + bool rollover(helpers::Pool& p) override; protected: /** Actual writing occurs here. */ - void subAppend(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; + void subAppend(const spi::LoggingEventPtr& event, helpers::Pool& p) override; bool rolloverInternal(log4cxx::helpers::Pool& p); diff --git a/src/main/include/log4cxx/rolling/rollingfileappender.h b/src/main/include/log4cxx/rolling/rollingfileappender.h index 3d299f75a..b44f7b8de 100644 --- a/src/main/include/log4cxx/rolling/rollingfileappender.h +++ b/src/main/include/log4cxx/rolling/rollingfileappender.h @@ -130,7 +130,7 @@ class LOG4CXX_EXPORT RollingFileAppender : public FileAppender void setOption( const LogString& option, const LogString& value ) override; /** Prepares RollingFileAppender for use. */ - void activateOptions(log4cxx::helpers::Pool& pool ) override; + void activateOptions(helpers::Pool& pool ) override; /** Implements the usual roll over behaviour. @@ -153,7 +153,7 @@ class LOG4CXX_EXPORT RollingFileAppender : public FileAppender /** Actual writing occurs here. */ - void subAppend(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; + void subAppend(const spi::LoggingEventPtr& event, helpers::Pool& p) override; bool rolloverInternal(log4cxx::helpers::Pool& p); diff --git a/src/main/include/log4cxx/rolling/rollingpolicybase.h b/src/main/include/log4cxx/rolling/rollingpolicybase.h index 0f7a4bb57..b8da4bd9d 100644 --- a/src/main/include/log4cxx/rolling/rollingpolicybase.h +++ b/src/main/include/log4cxx/rolling/rollingpolicybase.h @@ -56,7 +56,7 @@ class LOG4CXX_EXPORT RollingPolicyBase : public: RollingPolicyBase(); virtual ~RollingPolicyBase(); - virtual void activateOptions(log4cxx::helpers::Pool& p) = 0; + virtual void activateOptions(helpers::Pool& p) = 0; virtual log4cxx::pattern::PatternMap getFormatSpecifiers() const = 0; virtual void setOption(const LogString& option, diff --git a/src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h b/src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h index 9f0ce8596..0bbee5e56 100644 --- a/src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h +++ b/src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h @@ -74,7 +74,7 @@ class LOG4CXX_EXPORT SizeBasedTriggeringPolicy : public TriggeringPolicy void setMaxFileSize(size_t l); - void activateOptions(log4cxx::helpers::Pool&) override; + void activateOptions(helpers::Pool&) override; void setOption(const LogString& option, const LogString& value) override; }; diff --git a/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h b/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h index 459ff61ed..f2cb842ea 100755 --- a/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h +++ b/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h @@ -158,7 +158,7 @@ class LOG4CXX_EXPORT TimeBasedRollingPolicy : public RollingPolicyBase, public: TimeBasedRollingPolicy(); virtual ~TimeBasedRollingPolicy(); - void activateOptions(log4cxx::helpers::Pool& ) override; + void activateOptions(helpers::Pool& ) override; void setMultiprocess(bool multiprocess); @@ -168,7 +168,7 @@ class LOG4CXX_EXPORT TimeBasedRollingPolicy : public RollingPolicyBase, RolloverDescriptionPtr initialize( const LogString& currentActiveFile, const bool append, - log4cxx::helpers::Pool& pool) override; + helpers::Pool& pool) override; /** * {@inheritDoc} @@ -176,7 +176,7 @@ class LOG4CXX_EXPORT TimeBasedRollingPolicy : public RollingPolicyBase, RolloverDescriptionPtr rollover( const LogString& currentActiveFile, const bool append, - log4cxx::helpers::Pool& pool) override; + helpers::Pool& pool) override; /** * Determines if a rollover may be appropriate at this time. If diff --git a/src/main/include/log4cxx/simplelayout.h b/src/main/include/log4cxx/simplelayout.h index 6d2bf6c86..9bb4f9f44 100644 --- a/src/main/include/log4cxx/simplelayout.h +++ b/src/main/include/log4cxx/simplelayout.h @@ -59,7 +59,7 @@ class LOG4CXX_EXPORT SimpleLayout : public Layout */ void format(LogString& output, const spi::LoggingEventPtr& event, - log4cxx::helpers::Pool& pool) const override; + helpers::Pool& pool) const override; /** The SimpleLayout does not handle the throwable contained within @@ -71,7 +71,7 @@ class LOG4CXX_EXPORT SimpleLayout : public Layout return true; } - void activateOptions(log4cxx::helpers::Pool& /* p */) override {} + void activateOptions(helpers::Pool& /* p */) override {} void setOption(const LogString& /* option */, const LogString& /* value */) override {} }; diff --git a/src/main/include/log4cxx/spi/filter.h b/src/main/include/log4cxx/spi/filter.h index ad3b4605d..46d7e55ee 100644 --- a/src/main/include/log4cxx/spi/filter.h +++ b/src/main/include/log4cxx/spi/filter.h @@ -109,7 +109,7 @@ class LOG4CXX_EXPORT Filter : public virtual OptionHandler default do-nothing implementation for convenience. */ - void activateOptions(log4cxx::helpers::Pool& p) override; + void activateOptions(helpers::Pool& p) override; void setOption(const LogString& option, const LogString& value) override; /** diff --git a/src/main/include/log4cxx/spi/optionhandler.h b/src/main/include/log4cxx/spi/optionhandler.h index 18b74bfcc..1daeb6c3c 100644 --- a/src/main/include/log4cxx/spi/optionhandler.h +++ b/src/main/include/log4cxx/spi/optionhandler.h @@ -49,7 +49,7 @@ class LOG4CXX_EXPORT OptionHandler : public virtual helpers::Object FileAppender#setFile File} and {@link FileAppender#setAppend Append} options both of which are ambigous until the other is also set. */ - virtual void activateOptions(log4cxx::helpers::Pool& p) = 0; + virtual void activateOptions(helpers::Pool& p) = 0; /** diff --git a/src/main/include/log4cxx/varia/fallbackerrorhandler.h b/src/main/include/log4cxx/varia/fallbackerrorhandler.h index 623c85d9a..7676fac3b 100644 --- a/src/main/include/log4cxx/varia/fallbackerrorhandler.h +++ b/src/main/include/log4cxx/varia/fallbackerrorhandler.h @@ -64,7 +64,7 @@ class LOG4CXX_EXPORT FallbackErrorHandler : /** No options to activate. */ - void activateOptions(log4cxx::helpers::Pool& p) override; + void activateOptions(helpers::Pool& p) override; void setOption(const LogString& option, const LogString& value) override; diff --git a/src/main/include/log4cxx/writerappender.h b/src/main/include/log4cxx/writerappender.h index 08ce9fc29..bf07f5c09 100644 --- a/src/main/include/log4cxx/writerappender.h +++ b/src/main/include/log4cxx/writerappender.h @@ -66,7 +66,7 @@ class LOG4CXX_EXPORT WriterAppender : public AppenderSkeleton Derived appenders should override this method if option structure requires it. */ - void activateOptions(log4cxx::helpers::Pool& pool) override; + void activateOptions(helpers::Pool& pool) override; /** If the ImmediateFlush option is set to @@ -100,7 +100,7 @@ class LOG4CXX_EXPORT WriterAppender : public AppenderSkeleton layout. */ - void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; + void append(const spi::LoggingEventPtr& event, helpers::Pool& p) override; protected: diff --git a/src/main/include/log4cxx/xml/xmllayout.h b/src/main/include/log4cxx/xml/xmllayout.h index a51fee4b5..2bde2bc9b 100644 --- a/src/main/include/log4cxx/xml/xmllayout.h +++ b/src/main/include/log4cxx/xml/xmllayout.h @@ -99,7 +99,7 @@ class LOG4CXX_EXPORT XMLLayout : public Layout /** No options to activate. */ - void activateOptions(log4cxx::helpers::Pool& /* p */) override { } + void activateOptions(helpers::Pool& /* p */) override { } /** Set options From f142e967ea170e7d41332d733c2c95583a90758b Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sun, 13 Nov 2022 13:18:41 +1100 Subject: [PATCH 11/17] Prevent Clang warning messages --- src/main/include/log4cxx/pattern/classnamepatternconverter.h | 2 +- src/main/include/log4cxx/pattern/colorendpatternconverter.h | 2 +- src/main/include/log4cxx/pattern/colorstartpatternconverter.h | 2 +- src/main/include/log4cxx/pattern/filelocationpatternconverter.h | 2 +- src/main/include/log4cxx/pattern/fulllocationpatternconverter.h | 2 +- src/main/include/log4cxx/pattern/levelpatternconverter.h | 2 +- src/main/include/log4cxx/pattern/linelocationpatternconverter.h | 2 +- .../include/log4cxx/pattern/lineseparatorpatternconverter.h | 2 +- src/main/include/log4cxx/pattern/loggerpatternconverter.h | 2 +- src/main/include/log4cxx/pattern/messagepatternconverter.h | 2 +- .../include/log4cxx/pattern/methodlocationpatternconverter.h | 2 +- src/main/include/log4cxx/pattern/ndcpatternconverter.h | 2 +- src/main/include/log4cxx/pattern/propertiespatternconverter.h | 2 +- src/main/include/log4cxx/pattern/relativetimepatternconverter.h | 2 +- .../include/log4cxx/pattern/shortfilelocationpatternconverter.h | 2 +- src/main/include/log4cxx/pattern/threadpatternconverter.h | 2 +- .../include/log4cxx/pattern/threadusernamepatternconverter.h | 2 +- .../log4cxx/pattern/throwableinformationpatternconverter.h | 2 +- src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h | 2 +- src/main/include/log4cxx/rolling/manualtriggeringpolicy.h | 2 +- src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h | 2 +- src/main/include/log4cxx/rolling/timebasedrollingpolicy.h | 2 +- src/main/include/log4cxx/rolling/triggeringpolicy.h | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/main/include/log4cxx/pattern/classnamepatternconverter.h b/src/main/include/log4cxx/pattern/classnamepatternconverter.h index 44fc0efa1..067dee6af 100644 --- a/src/main/include/log4cxx/pattern/classnamepatternconverter.h +++ b/src/main/include/log4cxx/pattern/classnamepatternconverter.h @@ -58,7 +58,7 @@ class LOG4CXX_EXPORT ClassNamePatternConverter : public NamePatternConverter using NamePatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p) const override; }; diff --git a/src/main/include/log4cxx/pattern/colorendpatternconverter.h b/src/main/include/log4cxx/pattern/colorendpatternconverter.h index 07317b5e1..4d2aefa5d 100644 --- a/src/main/include/log4cxx/pattern/colorendpatternconverter.h +++ b/src/main/include/log4cxx/pattern/colorendpatternconverter.h @@ -54,7 +54,7 @@ class LOG4CXX_EXPORT ColorEndPatternConverter using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p) const override; }; diff --git a/src/main/include/log4cxx/pattern/colorstartpatternconverter.h b/src/main/include/log4cxx/pattern/colorstartpatternconverter.h index 837266046..3ce700ab4 100644 --- a/src/main/include/log4cxx/pattern/colorstartpatternconverter.h +++ b/src/main/include/log4cxx/pattern/colorstartpatternconverter.h @@ -55,7 +55,7 @@ class LOG4CXX_EXPORT ColorStartPatternConverter using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p) const override; }; diff --git a/src/main/include/log4cxx/pattern/filelocationpatternconverter.h b/src/main/include/log4cxx/pattern/filelocationpatternconverter.h index c133885c7..a7c5c1846 100644 --- a/src/main/include/log4cxx/pattern/filelocationpatternconverter.h +++ b/src/main/include/log4cxx/pattern/filelocationpatternconverter.h @@ -54,7 +54,7 @@ class LOG4CXX_EXPORT FileLocationPatternConverter using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p) const override; }; diff --git a/src/main/include/log4cxx/pattern/fulllocationpatternconverter.h b/src/main/include/log4cxx/pattern/fulllocationpatternconverter.h index 3e4d95921..6620c8a5a 100644 --- a/src/main/include/log4cxx/pattern/fulllocationpatternconverter.h +++ b/src/main/include/log4cxx/pattern/fulllocationpatternconverter.h @@ -54,7 +54,7 @@ class LOG4CXX_EXPORT FullLocationPatternConverter using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p) const override; }; diff --git a/src/main/include/log4cxx/pattern/levelpatternconverter.h b/src/main/include/log4cxx/pattern/levelpatternconverter.h index c19a9d08f..4aaceb1ee 100644 --- a/src/main/include/log4cxx/pattern/levelpatternconverter.h +++ b/src/main/include/log4cxx/pattern/levelpatternconverter.h @@ -53,7 +53,7 @@ class LOG4CXX_EXPORT LevelPatternConverter : public LoggingEventPatternConverter using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p) const override; diff --git a/src/main/include/log4cxx/pattern/linelocationpatternconverter.h b/src/main/include/log4cxx/pattern/linelocationpatternconverter.h index b025ddd7d..2a1444fb1 100644 --- a/src/main/include/log4cxx/pattern/linelocationpatternconverter.h +++ b/src/main/include/log4cxx/pattern/linelocationpatternconverter.h @@ -54,7 +54,7 @@ class LOG4CXX_EXPORT LineLocationPatternConverter using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p) const override; }; diff --git a/src/main/include/log4cxx/pattern/lineseparatorpatternconverter.h b/src/main/include/log4cxx/pattern/lineseparatorpatternconverter.h index 50d4db146..7a04dfc50 100644 --- a/src/main/include/log4cxx/pattern/lineseparatorpatternconverter.h +++ b/src/main/include/log4cxx/pattern/lineseparatorpatternconverter.h @@ -54,7 +54,7 @@ class LOG4CXX_EXPORT LineSeparatorPatternConverter using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p) const override; diff --git a/src/main/include/log4cxx/pattern/loggerpatternconverter.h b/src/main/include/log4cxx/pattern/loggerpatternconverter.h index e492c51b9..f25add70f 100644 --- a/src/main/include/log4cxx/pattern/loggerpatternconverter.h +++ b/src/main/include/log4cxx/pattern/loggerpatternconverter.h @@ -54,7 +54,7 @@ class LOG4CXX_EXPORT LoggerPatternConverter : public NamePatternConverter using NamePatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p) const override; }; diff --git a/src/main/include/log4cxx/pattern/messagepatternconverter.h b/src/main/include/log4cxx/pattern/messagepatternconverter.h index 07868e527..0ff46b232 100644 --- a/src/main/include/log4cxx/pattern/messagepatternconverter.h +++ b/src/main/include/log4cxx/pattern/messagepatternconverter.h @@ -53,7 +53,7 @@ class LOG4CXX_EXPORT MessagePatternConverter : public LoggingEventPatternConvert using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p) const override; }; diff --git a/src/main/include/log4cxx/pattern/methodlocationpatternconverter.h b/src/main/include/log4cxx/pattern/methodlocationpatternconverter.h index a9ff53c37..1a5d5ce92 100644 --- a/src/main/include/log4cxx/pattern/methodlocationpatternconverter.h +++ b/src/main/include/log4cxx/pattern/methodlocationpatternconverter.h @@ -54,7 +54,7 @@ class LOG4CXX_EXPORT MethodLocationPatternConverter using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p) const override; }; diff --git a/src/main/include/log4cxx/pattern/ndcpatternconverter.h b/src/main/include/log4cxx/pattern/ndcpatternconverter.h index c06faa702..dd89f1940 100644 --- a/src/main/include/log4cxx/pattern/ndcpatternconverter.h +++ b/src/main/include/log4cxx/pattern/ndcpatternconverter.h @@ -53,7 +53,7 @@ class LOG4CXX_EXPORT NDCPatternConverter : public LoggingEventPatternConverter using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p) const override; }; diff --git a/src/main/include/log4cxx/pattern/propertiespatternconverter.h b/src/main/include/log4cxx/pattern/propertiespatternconverter.h index cc1568974..0882fc23a 100644 --- a/src/main/include/log4cxx/pattern/propertiespatternconverter.h +++ b/src/main/include/log4cxx/pattern/propertiespatternconverter.h @@ -64,7 +64,7 @@ class LOG4CXX_EXPORT PropertiesPatternConverter using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, log4cxx::helpers::Pool& p) const; }; diff --git a/src/main/include/log4cxx/pattern/relativetimepatternconverter.h b/src/main/include/log4cxx/pattern/relativetimepatternconverter.h index 2e02bc72e..358716084 100644 --- a/src/main/include/log4cxx/pattern/relativetimepatternconverter.h +++ b/src/main/include/log4cxx/pattern/relativetimepatternconverter.h @@ -57,7 +57,7 @@ class LOG4CXX_EXPORT RelativeTimePatternConverter : public LoggingEventPatternCo using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, log4cxx::helpers::Pool& p) const; }; diff --git a/src/main/include/log4cxx/pattern/shortfilelocationpatternconverter.h b/src/main/include/log4cxx/pattern/shortfilelocationpatternconverter.h index 98456b11f..329c09230 100644 --- a/src/main/include/log4cxx/pattern/shortfilelocationpatternconverter.h +++ b/src/main/include/log4cxx/pattern/shortfilelocationpatternconverter.h @@ -57,7 +57,7 @@ class LOG4CXX_EXPORT ShortFileLocationPatternConverter using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p) const override; }; diff --git a/src/main/include/log4cxx/pattern/threadpatternconverter.h b/src/main/include/log4cxx/pattern/threadpatternconverter.h index dad74180e..fee917f80 100644 --- a/src/main/include/log4cxx/pattern/threadpatternconverter.h +++ b/src/main/include/log4cxx/pattern/threadpatternconverter.h @@ -53,7 +53,7 @@ class LOG4CXX_EXPORT ThreadPatternConverter : public LoggingEventPatternConverte using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p) const override; }; diff --git a/src/main/include/log4cxx/pattern/threadusernamepatternconverter.h b/src/main/include/log4cxx/pattern/threadusernamepatternconverter.h index b8e2c1302..e9aee1c96 100644 --- a/src/main/include/log4cxx/pattern/threadusernamepatternconverter.h +++ b/src/main/include/log4cxx/pattern/threadusernamepatternconverter.h @@ -42,7 +42,7 @@ class LOG4CXX_EXPORT ThreadUsernamePatternConverter : public LoggingEventPattern static PatternConverterPtr newInstance( const std::vector& options); - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, log4cxx::helpers::Pool& p) const; }; diff --git a/src/main/include/log4cxx/pattern/throwableinformationpatternconverter.h b/src/main/include/log4cxx/pattern/throwableinformationpatternconverter.h index 1a07ca300..c13c617e1 100644 --- a/src/main/include/log4cxx/pattern/throwableinformationpatternconverter.h +++ b/src/main/include/log4cxx/pattern/throwableinformationpatternconverter.h @@ -59,7 +59,7 @@ class LOG4CXX_EXPORT ThrowableInformationPatternConverter using LoggingEventPatternConverter::format; - void format(const log4cxx::spi::LoggingEventPtr& event, + void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, helpers::Pool& p) const override; diff --git a/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h b/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h index 8d1adfe0d..db87d3085 100644 --- a/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h +++ b/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h @@ -86,7 +86,7 @@ class LOG4CXX_EXPORT FilterBasedTriggeringPolicy : public TriggeringPolicy */ bool isTriggeringEvent( Appender* appender, - const log4cxx::spi::LoggingEventPtr& event, + const spi::LoggingEventPtr& event, const LogString& filename, size_t fileLength) override; diff --git a/src/main/include/log4cxx/rolling/manualtriggeringpolicy.h b/src/main/include/log4cxx/rolling/manualtriggeringpolicy.h index 50841bce8..f3a1b0995 100644 --- a/src/main/include/log4cxx/rolling/manualtriggeringpolicy.h +++ b/src/main/include/log4cxx/rolling/manualtriggeringpolicy.h @@ -63,7 +63,7 @@ class LOG4CXX_EXPORT ManualTriggeringPolicy : public TriggeringPolicy */ bool isTriggeringEvent( Appender* appender, - const log4cxx::spi::LoggingEventPtr& event, + const spi::LoggingEventPtr& event, const LogString& filename, size_t fileLength) override; diff --git a/src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h b/src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h index 0bbee5e56..b0d71e1f6 100644 --- a/src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h +++ b/src/main/include/log4cxx/rolling/sizebasedtriggeringpolicy.h @@ -66,7 +66,7 @@ class LOG4CXX_EXPORT SizeBasedTriggeringPolicy : public TriggeringPolicy */ bool isTriggeringEvent( Appender* appender, - const log4cxx::spi::LoggingEventPtr& event, + const spi::LoggingEventPtr& event, const LogString& filename, size_t fileLength) override; diff --git a/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h b/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h index f2cb842ea..69bf44691 100755 --- a/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h +++ b/src/main/include/log4cxx/rolling/timebasedrollingpolicy.h @@ -191,7 +191,7 @@ class LOG4CXX_EXPORT TimeBasedRollingPolicy : public RollingPolicyBase, */ bool isTriggeringEvent( Appender* appender, - const log4cxx::spi::LoggingEventPtr& event, + const spi::LoggingEventPtr& event, const LogString& filename, size_t fileLength) override; diff --git a/src/main/include/log4cxx/rolling/triggeringpolicy.h b/src/main/include/log4cxx/rolling/triggeringpolicy.h index 439a21adc..f004aabd7 100644 --- a/src/main/include/log4cxx/rolling/triggeringpolicy.h +++ b/src/main/include/log4cxx/rolling/triggeringpolicy.h @@ -66,7 +66,7 @@ class LOG4CXX_EXPORT TriggeringPolicy : */ virtual bool isTriggeringEvent( Appender* appender, - const log4cxx::spi::LoggingEventPtr& event, + const spi::LoggingEventPtr& event, const LogString& filename, size_t fileLength) = 0; From 5bf108523b4045b7fe90fa285bb4afdafd480706 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sun, 13 Nov 2022 13:32:11 +1100 Subject: [PATCH 12/17] Prevent Clang warning messages --- src/main/include/log4cxx/appenderskeleton.h | 4 ++-- src/main/include/log4cxx/db/odbcappender.h | 2 +- src/main/include/log4cxx/filter/stringmatchfilter.h | 3 +-- src/main/include/log4cxx/helpers/fileinputstream.h | 4 ++-- src/main/include/log4cxx/pattern/levelpatternconverter.h | 2 +- .../include/log4cxx/pattern/lineseparatorpatternconverter.h | 4 ++-- src/main/include/log4cxx/pattern/namepatternconverter.h | 2 +- src/main/include/log4cxx/private/aprdatagramsocket.h | 2 +- src/main/include/log4cxx/private/aprserversocket.h | 2 +- src/main/include/log4cxx/rolling/filerenameaction.h | 2 +- src/main/include/log4cxx/rolling/gzcompressaction.h | 2 +- src/main/include/log4cxx/rolling/rollingpolicybase.h | 4 +--- src/main/include/log4cxx/rolling/zipcompressaction.h | 2 +- src/main/include/log4cxx/spi/defaultrepositoryselector.h | 2 +- 14 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/main/include/log4cxx/appenderskeleton.h b/src/main/include/log4cxx/appenderskeleton.h index 452815ed8..b04c2c056 100644 --- a/src/main/include/log4cxx/appenderskeleton.h +++ b/src/main/include/log4cxx/appenderskeleton.h @@ -74,8 +74,8 @@ class LOG4CXX_EXPORT AppenderSkeleton : Derived appenders should override this method if option structure requires it. */ - virtual void activateOptions(helpers::Pool& /* pool */) override {} - virtual void setOption(const LogString& option, const LogString& value) override; + void activateOptions(helpers::Pool& /* pool */) override {} + void setOption(const LogString& option, const LogString& value) override; /** Add a filter to end of the filter list. diff --git a/src/main/include/log4cxx/db/odbcappender.h b/src/main/include/log4cxx/db/odbcappender.h index d7f2ce44b..b4104b977 100644 --- a/src/main/include/log4cxx/db/odbcappender.h +++ b/src/main/include/log4cxx/db/odbcappender.h @@ -116,7 +116,7 @@ class LOG4CXX_EXPORT ODBCAppender : public AppenderSkeleton /** Set options */ - virtual void setOption(const LogString& option, const LogString& value) override; + void setOption(const LogString& option, const LogString& value) override; /** Activate the specified options. diff --git a/src/main/include/log4cxx/filter/stringmatchfilter.h b/src/main/include/log4cxx/filter/stringmatchfilter.h index 5da8f8240..c4d5763a4 100644 --- a/src/main/include/log4cxx/filter/stringmatchfilter.h +++ b/src/main/include/log4cxx/filter/stringmatchfilter.h @@ -69,8 +69,7 @@ class LOG4CXX_EXPORT StringMatchFilter : public spi::Filter /** Set options */ - virtual void setOption(const LogString& option, - const LogString& value); + void setOption(const LogString& option, const LogString& value) override; void setStringToMatch(const LogString& stringToMatch1); diff --git a/src/main/include/log4cxx/helpers/fileinputstream.h b/src/main/include/log4cxx/helpers/fileinputstream.h index ab907c856..754997b67 100644 --- a/src/main/include/log4cxx/helpers/fileinputstream.h +++ b/src/main/include/log4cxx/helpers/fileinputstream.h @@ -68,7 +68,7 @@ class LOG4CXX_EXPORT FileInputStream : public InputStream * Closes this file input stream and releases any system * resources associated with the stream. */ - virtual void close(); + void close() override; /** * Reads a sequence of bytes into the given buffer. @@ -77,7 +77,7 @@ class LOG4CXX_EXPORT FileInputStream : public InputStream * @return the total number of bytes read into the buffer, or -1 if there * is no more data because the end of the stream has been reached. */ - virtual int read(ByteBuffer& buf); + int read(ByteBuffer& buf) override; private: diff --git a/src/main/include/log4cxx/pattern/levelpatternconverter.h b/src/main/include/log4cxx/pattern/levelpatternconverter.h index 4aaceb1ee..df019f69f 100644 --- a/src/main/include/log4cxx/pattern/levelpatternconverter.h +++ b/src/main/include/log4cxx/pattern/levelpatternconverter.h @@ -57,7 +57,7 @@ class LOG4CXX_EXPORT LevelPatternConverter : public LoggingEventPatternConverter LogString& toAppendTo, helpers::Pool& p) const override; - LogString getStyleClass(const log4cxx::helpers::ObjectPtr& e) const; + LogString getStyleClass(const helpers::ObjectPtr& e) const override; }; } } diff --git a/src/main/include/log4cxx/pattern/lineseparatorpatternconverter.h b/src/main/include/log4cxx/pattern/lineseparatorpatternconverter.h index 7a04dfc50..048e534cf 100644 --- a/src/main/include/log4cxx/pattern/lineseparatorpatternconverter.h +++ b/src/main/include/log4cxx/pattern/lineseparatorpatternconverter.h @@ -58,9 +58,9 @@ class LOG4CXX_EXPORT LineSeparatorPatternConverter LogString& toAppendTo, helpers::Pool& p) const override; - void format(const log4cxx::helpers::ObjectPtr& obj, + void format(const helpers::ObjectPtr& obj, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + helpers::Pool& p) const override; }; } diff --git a/src/main/include/log4cxx/pattern/namepatternconverter.h b/src/main/include/log4cxx/pattern/namepatternconverter.h index 436a5e2ca..0ba8714d7 100644 --- a/src/main/include/log4cxx/pattern/namepatternconverter.h +++ b/src/main/include/log4cxx/pattern/namepatternconverter.h @@ -62,7 +62,7 @@ class LOG4CXX_EXPORT NamePatternConverter : public LoggingEventPatternConverter * @param nameStart starting position of name to abbreviate. * @param buf string buffer containing name. */ - void abbreviate(int nameStart, LogString& buf) const; + void abbreviate(int nameStart, LogString& buf) const override; private: NameAbbreviatorPtr getAbbreviator(const std::vector& options); diff --git a/src/main/include/log4cxx/private/aprdatagramsocket.h b/src/main/include/log4cxx/private/aprdatagramsocket.h index 0f75cd0ac..82e25d55d 100644 --- a/src/main/include/log4cxx/private/aprdatagramsocket.h +++ b/src/main/include/log4cxx/private/aprdatagramsocket.h @@ -37,7 +37,7 @@ class APRDatagramSocket : public DatagramSocket { virtual void bind(int lport, InetAddressPtr laddress); - virtual void close(); + void close() override; virtual bool isClosed() const; diff --git a/src/main/include/log4cxx/private/aprserversocket.h b/src/main/include/log4cxx/private/aprserversocket.h index b05aba91b..761777942 100644 --- a/src/main/include/log4cxx/private/aprserversocket.h +++ b/src/main/include/log4cxx/private/aprserversocket.h @@ -33,7 +33,7 @@ class LOG4CXX_EXPORT APRServerSocket : public helpers::ServerSocket public: APRServerSocket(int port); - void close(); + void close() override; SocketPtr accept(); diff --git a/src/main/include/log4cxx/rolling/filerenameaction.h b/src/main/include/log4cxx/rolling/filerenameaction.h index b572bd03e..ba33faaad 100644 --- a/src/main/include/log4cxx/rolling/filerenameaction.h +++ b/src/main/include/log4cxx/rolling/filerenameaction.h @@ -49,7 +49,7 @@ class FileRenameAction : public Action * * @return true if successful. */ - virtual bool execute(log4cxx::helpers::Pool& pool) const; + bool execute(log4cxx::helpers::Pool& pool) const override; }; LOG4CXX_PTR_DEF(FileRenameAction); diff --git a/src/main/include/log4cxx/rolling/gzcompressaction.h b/src/main/include/log4cxx/rolling/gzcompressaction.h index e087cb6dc..f74f70a9e 100644 --- a/src/main/include/log4cxx/rolling/gzcompressaction.h +++ b/src/main/include/log4cxx/rolling/gzcompressaction.h @@ -55,7 +55,7 @@ class GZCompressAction : public Action * * @return true if successful. */ - virtual bool execute(log4cxx::helpers::Pool& pool) const; + bool execute(log4cxx::helpers::Pool& pool) const override; private: GZCompressAction(const GZCompressAction&); diff --git a/src/main/include/log4cxx/rolling/rollingpolicybase.h b/src/main/include/log4cxx/rolling/rollingpolicybase.h index b8da4bd9d..830ce1f65 100644 --- a/src/main/include/log4cxx/rolling/rollingpolicybase.h +++ b/src/main/include/log4cxx/rolling/rollingpolicybase.h @@ -56,11 +56,9 @@ class LOG4CXX_EXPORT RollingPolicyBase : public: RollingPolicyBase(); virtual ~RollingPolicyBase(); - virtual void activateOptions(helpers::Pool& p) = 0; virtual log4cxx::pattern::PatternMap getFormatSpecifiers() const = 0; - virtual void setOption(const LogString& option, - const LogString& value); + void setOption(const LogString& option, const LogString& value) override; /** * Set file name pattern. diff --git a/src/main/include/log4cxx/rolling/zipcompressaction.h b/src/main/include/log4cxx/rolling/zipcompressaction.h index 91762b108..5ed0a555c 100644 --- a/src/main/include/log4cxx/rolling/zipcompressaction.h +++ b/src/main/include/log4cxx/rolling/zipcompressaction.h @@ -55,7 +55,7 @@ class ZipCompressAction : public Action * * @return true if successful. */ - virtual bool execute(log4cxx::helpers::Pool& pool) const; + bool execute(log4cxx::helpers::Pool& pool) const override; private: ZipCompressAction(const ZipCompressAction&); diff --git a/src/main/include/log4cxx/spi/defaultrepositoryselector.h b/src/main/include/log4cxx/spi/defaultrepositoryselector.h index 8059f4d08..e642b3e6b 100644 --- a/src/main/include/log4cxx/spi/defaultrepositoryselector.h +++ b/src/main/include/log4cxx/spi/defaultrepositoryselector.h @@ -39,7 +39,7 @@ class LOG4CXX_EXPORT DefaultRepositorySelector : DefaultRepositorySelector(const LoggerRepositoryPtr repository1); ~DefaultRepositorySelector(); - virtual LoggerRepositoryPtr getLoggerRepository(); + LoggerRepositoryPtr getLoggerRepository() override; private: LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(DefaultRepositorySelectorPrivate, m_priv) From 3d3de8d481fb9449e22b4851ba9106859fecb1b8 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sun, 13 Nov 2022 13:45:22 +1100 Subject: [PATCH 13/17] Prevent Clang warning messages --- src/main/cpp/namepatternconverter.cpp | 2 +- src/main/include/log4cxx/filter/andfilter.h | 4 ++-- src/main/include/log4cxx/pattern/namepatternconverter.h | 2 +- .../include/log4cxx/rolling/filterbasedtriggeringpolicy.h | 2 +- src/main/include/log4cxx/rolling/rollingpolicybase.h | 1 + 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/cpp/namepatternconverter.cpp b/src/main/cpp/namepatternconverter.cpp index 99f79bc2b..ebc3d24de 100644 --- a/src/main/cpp/namepatternconverter.cpp +++ b/src/main/cpp/namepatternconverter.cpp @@ -70,7 +70,7 @@ NameAbbreviatorPtr NamePatternConverter::getAbbreviator( * @param nameStart starting position of name to abbreviate. * @param buf string buffer containing name. */ -void NamePatternConverter::abbreviate(int nameStart, LogString& buf) const +void NamePatternConverter::abbreviate(LogString::size_type nameStart, LogString& buf) const { priv->abbreviator->abbreviate(nameStart, buf); } diff --git a/src/main/include/log4cxx/filter/andfilter.h b/src/main/include/log4cxx/filter/andfilter.h index 2e4033e89..2d4a30d90 100644 --- a/src/main/include/log4cxx/filter/andfilter.h +++ b/src/main/include/log4cxx/filter/andfilter.h @@ -93,11 +93,11 @@ class LOG4CXX_EXPORT AndFilter: public log4cxx::spi::Filter AndFilter(); ~AndFilter(); - void addFilter(const log4cxx::spi::FilterPtr& filter); + void addFilter(const spi::FilterPtr& filter); void setAcceptOnMatch(bool acceptOnMatch); - FilterDecision decide(const spi::LoggingEventPtr& event) const; + FilterDecision decide(const spi::LoggingEventPtr& event) const override; }; LOG4CXX_PTR_DEF(AndFilter); diff --git a/src/main/include/log4cxx/pattern/namepatternconverter.h b/src/main/include/log4cxx/pattern/namepatternconverter.h index 0ba8714d7..f133f192f 100644 --- a/src/main/include/log4cxx/pattern/namepatternconverter.h +++ b/src/main/include/log4cxx/pattern/namepatternconverter.h @@ -62,7 +62,7 @@ class LOG4CXX_EXPORT NamePatternConverter : public LoggingEventPatternConverter * @param nameStart starting position of name to abbreviate. * @param buf string buffer containing name. */ - void abbreviate(int nameStart, LogString& buf) const override; + void abbreviate(LogString::size_type nameStart, LogString& buf) const; private: NameAbbreviatorPtr getAbbreviator(const std::vector& options); diff --git a/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h b/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h index db87d3085..97f30b3e6 100644 --- a/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h +++ b/src/main/include/log4cxx/rolling/filterbasedtriggeringpolicy.h @@ -94,7 +94,7 @@ class LOG4CXX_EXPORT FilterBasedTriggeringPolicy : public TriggeringPolicy * Add a filter to end of the filter list. * @param newFilter filter to add to end of list. */ - void addFilter(const log4cxx::spi::FilterPtr& newFilter); + void addFilter(const spi::FilterPtr& newFilter); /** * Clear the filters chain. diff --git a/src/main/include/log4cxx/rolling/rollingpolicybase.h b/src/main/include/log4cxx/rolling/rollingpolicybase.h index 830ce1f65..4ab300083 100644 --- a/src/main/include/log4cxx/rolling/rollingpolicybase.h +++ b/src/main/include/log4cxx/rolling/rollingpolicybase.h @@ -56,6 +56,7 @@ class LOG4CXX_EXPORT RollingPolicyBase : public: RollingPolicyBase(); virtual ~RollingPolicyBase(); + void activateOptions(log4cxx::helpers::Pool& p) override; virtual log4cxx::pattern::PatternMap getFormatSpecifiers() const = 0; void setOption(const LogString& option, const LogString& value) override; From 7b3f71b4b8a1c2fae782ee713fada57b91f7375b Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sun, 13 Nov 2022 14:02:59 +1100 Subject: [PATCH 14/17] Prevent Clang warning messages --- src/main/cpp/nameabbreviator.cpp | 6 +++--- .../include/log4cxx/helpers/propertyresourcebundle.h | 2 +- .../log4cxx/pattern/propertiespatternconverter.h | 2 +- .../log4cxx/pattern/relativetimepatternconverter.h | 2 +- .../log4cxx/pattern/threadusernamepatternconverter.h | 2 +- .../pattern/throwableinformationpatternconverter.h | 2 +- src/main/include/log4cxx/private/aprdatagramsocket.h | 10 +++++----- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/cpp/nameabbreviator.cpp b/src/main/cpp/nameabbreviator.cpp index e2129767b..6052a75f8 100644 --- a/src/main/cpp/nameabbreviator.cpp +++ b/src/main/cpp/nameabbreviator.cpp @@ -61,7 +61,7 @@ class NOPAbbreviator : public NameAbbreviator /** * {@inheritDoc} */ - void abbreviate(LogString::size_type /* nameStart */, LogString& /* buf */) const + void abbreviate(LogString::size_type /* nameStart */, LogString& /* buf */) const override { } }; @@ -96,7 +96,7 @@ class MaxElementAbbreviator : public NameAbbreviator * @param buf buffer to append abbreviation. * @param nameStart start of name to abbreviate. */ - void abbreviate(LogString::size_type nameStart, LogString& buf) const + void abbreviate(LogString::size_type nameStart, LogString& buf) const override { // We substract 1 from 'len' when assigning to 'end' to avoid out of // bounds exception in return r.substring(end+1, len). This can happen if @@ -230,7 +230,7 @@ class PatternAbbreviator : public NameAbbreviator * @param buf buffer that abbreviated name is appended. * @param nameStart start of name. */ - void abbreviate(LogString::size_type nameStart, LogString& buf) const + void abbreviate(LogString::size_type nameStart, LogString& buf) const override { // // all non-terminal patterns are executed once diff --git a/src/main/include/log4cxx/helpers/propertyresourcebundle.h b/src/main/include/log4cxx/helpers/propertyresourcebundle.h index 1bba8c534..ce9920c74 100644 --- a/src/main/include/log4cxx/helpers/propertyresourcebundle.h +++ b/src/main/include/log4cxx/helpers/propertyresourcebundle.h @@ -49,7 +49,7 @@ class LOG4CXX_EXPORT PropertyResourceBundle : public ResourceBundle */ PropertyResourceBundle(InputStreamPtr inStream); - virtual LogString getString(const LogString& key) const; + LogString getString(const LogString& key) const override; protected: Properties properties; diff --git a/src/main/include/log4cxx/pattern/propertiespatternconverter.h b/src/main/include/log4cxx/pattern/propertiespatternconverter.h index 0882fc23a..f3aea02cb 100644 --- a/src/main/include/log4cxx/pattern/propertiespatternconverter.h +++ b/src/main/include/log4cxx/pattern/propertiespatternconverter.h @@ -66,7 +66,7 @@ class LOG4CXX_EXPORT PropertiesPatternConverter void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + log4cxx::helpers::Pool& p) const override; }; } } diff --git a/src/main/include/log4cxx/pattern/relativetimepatternconverter.h b/src/main/include/log4cxx/pattern/relativetimepatternconverter.h index 358716084..2e66c9a88 100644 --- a/src/main/include/log4cxx/pattern/relativetimepatternconverter.h +++ b/src/main/include/log4cxx/pattern/relativetimepatternconverter.h @@ -59,7 +59,7 @@ class LOG4CXX_EXPORT RelativeTimePatternConverter : public LoggingEventPatternCo void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + log4cxx::helpers::Pool& p) const override; }; } } diff --git a/src/main/include/log4cxx/pattern/threadusernamepatternconverter.h b/src/main/include/log4cxx/pattern/threadusernamepatternconverter.h index e9aee1c96..1751428b1 100644 --- a/src/main/include/log4cxx/pattern/threadusernamepatternconverter.h +++ b/src/main/include/log4cxx/pattern/threadusernamepatternconverter.h @@ -44,7 +44,7 @@ class LOG4CXX_EXPORT ThreadUsernamePatternConverter : public LoggingEventPattern void format(const spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& p) const; + log4cxx::helpers::Pool& p) const override; }; } diff --git a/src/main/include/log4cxx/pattern/throwableinformationpatternconverter.h b/src/main/include/log4cxx/pattern/throwableinformationpatternconverter.h index c13c617e1..72b6d4327 100644 --- a/src/main/include/log4cxx/pattern/throwableinformationpatternconverter.h +++ b/src/main/include/log4cxx/pattern/throwableinformationpatternconverter.h @@ -67,7 +67,7 @@ class LOG4CXX_EXPORT ThrowableInformationPatternConverter * This converter obviously handles throwables. * @return true. */ - bool handlesThrowable() const; + bool handlesThrowable() const override; }; } } diff --git a/src/main/include/log4cxx/private/aprdatagramsocket.h b/src/main/include/log4cxx/private/aprdatagramsocket.h index 82e25d55d..0aa567e26 100644 --- a/src/main/include/log4cxx/private/aprdatagramsocket.h +++ b/src/main/include/log4cxx/private/aprdatagramsocket.h @@ -35,19 +35,19 @@ class APRDatagramSocket : public DatagramSocket { APRDatagramSocket(int port, InetAddressPtr laddr); - virtual void bind(int lport, InetAddressPtr laddress); + void bind(int lport, InetAddressPtr laddress) override; void close() override; - virtual bool isClosed() const; + bool isClosed() const override; /** Receives a datagram packet from this socket. */ - virtual void receive(DatagramPacketPtr& p); + virtual void receive(DatagramPacketPtr& p) override; /** Sends a datagram packet from this socket. */ - virtual void send(DatagramPacketPtr& p); + virtual void send(DatagramPacketPtr& p) override; - virtual void connect(InetAddressPtr address, int port); + virtual void connect(InetAddressPtr address, int port) override; private: void init(); From 361ebf56b548a27197bcd075cf19bba4750db48b Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sun, 13 Nov 2022 14:09:12 +1100 Subject: [PATCH 15/17] Prevent Clang warning messages --- src/test/cpp/asyncappendertestcase.cpp | 4 ++-- src/test/cpp/benchmark/benchmark.cpp | 10 +++++----- src/test/cpp/loggertestcase.cpp | 6 +++--- src/test/cpp/throughput/log4cxxbenchmarker.cpp | 10 +++++----- src/test/cpp/vectorappender.h | 6 +++--- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/test/cpp/asyncappendertestcase.cpp b/src/test/cpp/asyncappendertestcase.cpp index edcf4c12c..2bf7638fc 100644 --- a/src/test/cpp/asyncappendertestcase.cpp +++ b/src/test/cpp/asyncappendertestcase.cpp @@ -48,7 +48,7 @@ class NullPointerAppender : public AppenderSkeleton /** * @{inheritDoc} */ - void append(const spi::LoggingEventPtr&, log4cxx::helpers::Pool&) + void append(const spi::LoggingEventPtr&, log4cxx::helpers::Pool&) override { throw NullPointerException(LOG4CXX_STR("Intentional NullPointerException")); } @@ -81,7 +81,7 @@ class BlockableVectorAppender : public VectorAppender /** * {@inheritDoc} */ - void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) + void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override { std::unique_lock lock( blocker ); VectorAppender::append(event, p); diff --git a/src/test/cpp/benchmark/benchmark.cpp b/src/test/cpp/benchmark/benchmark.cpp index 8a3f84e57..8641b7425 100644 --- a/src/test/cpp/benchmark/benchmark.cpp +++ b/src/test/cpp/benchmark/benchmark.cpp @@ -21,24 +21,24 @@ class NullWriterAppender : public AppenderSkeleton NullWriterAppender() {} - virtual void close() {} + void close() override {} - virtual bool requiresLayout() const + bool requiresLayout() const override { return true; } - virtual void append(const spi::LoggingEventPtr& event, helpers::Pool& p) + void append(const spi::LoggingEventPtr& event, helpers::Pool& p) override { // This gets called whenever there is a valid event for our appender. } - virtual void activateOptions(helpers::Pool& /* pool */) + void activateOptions(helpers::Pool& /* pool */) override { // Given all of our options, do something useful(e.g. open a file) } - virtual void setOption(const LogString& option, const LogString& value) + void setOption(const LogString& option, const LogString& value) override { } }; diff --git a/src/test/cpp/loggertestcase.cpp b/src/test/cpp/loggertestcase.cpp index 5ab296622..942b829e0 100644 --- a/src/test/cpp/loggertestcase.cpp +++ b/src/test/cpp/loggertestcase.cpp @@ -46,15 +46,15 @@ class CountingAppender : public AppenderSkeleton CountingAppender() : counter(0) {} - void close() + void close() override {} - void append(const spi::LoggingEventPtr& /*event*/, Pool& /*p*/) + void append(const spi::LoggingEventPtr& /*event*/, Pool& /*p*/) override { counter++; } - bool requiresLayout() const + bool requiresLayout() const override { return true; } diff --git a/src/test/cpp/throughput/log4cxxbenchmarker.cpp b/src/test/cpp/throughput/log4cxxbenchmarker.cpp index add71bbb4..da80abcc7 100644 --- a/src/test/cpp/throughput/log4cxxbenchmarker.cpp +++ b/src/test/cpp/throughput/log4cxxbenchmarker.cpp @@ -36,24 +36,24 @@ class NullWriterAppender : public log4cxx::AppenderSkeleton NullWriterAppender() {} - virtual void close() {} + void close() override {} - virtual bool requiresLayout() const + bool requiresLayout() const override { return true; } - virtual void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) + void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override { // This gets called whenever there is a valid event for our appender. } - virtual void activateOptions(log4cxx::helpers::Pool& /* pool */) + void activateOptions(log4cxx::helpers::Pool& /* pool */) override { // Given all of our options, do something useful(e.g. open a file) } - virtual void setOption(const LogString& option, const LogString& value) + void setOption(const LogString& option, const LogString& value) override { } }; diff --git a/src/test/cpp/vectorappender.h b/src/test/cpp/vectorappender.h index 2895e4f41..2e6d41715 100644 --- a/src/test/cpp/vectorappender.h +++ b/src/test/cpp/vectorappender.h @@ -43,21 +43,21 @@ class VectorAppender : public AppenderSkeleton This method is called by the AppenderSkeleton#doAppend method. */ - void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p); + void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override; const std::vector& getVector() const { return vector; } - void close(); + void close() override; bool isClosed() const { return m_priv->closed; } - bool requiresLayout() const + bool requiresLayout() const override { return false; } From f1a1bf31bbe0fd50e6ad74504b00f362c851b116 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sun, 13 Nov 2022 15:47:46 +1100 Subject: [PATCH 16/17] Prevent Clang warning messages --- src/examples/cpp/custom-appender.cpp | 10 +++++----- src/main/include/log4cxx/private/aprserversocket.h | 2 +- src/test/cpp/asyncappendertestcase.cpp | 4 ++-- src/test/cpp/customlogger/xlogger.h | 4 ++-- src/test/cpp/net/smtpappendertestcase.cpp | 2 +- src/test/cpp/pattern/num343patternconverter.h | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/examples/cpp/custom-appender.cpp b/src/examples/cpp/custom-appender.cpp index 5154090dd..51c485e82 100644 --- a/src/examples/cpp/custom-appender.cpp +++ b/src/examples/cpp/custom-appender.cpp @@ -34,21 +34,21 @@ class NullWriterAppender : public log4cxx::AppenderSkeleton { NullWriterAppender(){} - virtual void close(){} + void close() override{} - virtual bool requiresLayout() const { + bool requiresLayout() const override { return false; } - virtual void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p){ + void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) override { // This gets called whenever there is a valid event for our appender. } - virtual void activateOptions(log4cxx::helpers::Pool& /* pool */) { + void activateOptions(log4cxx::helpers::Pool& /* pool */) override { // Given all of our options, do something useful(e.g. open a file) } - virtual void setOption(const LogString& option, const LogString& value){ + void setOption(const LogString& option, const LogString& value) override { if (helpers::StringHelper::equalsIgnoreCase(option, LOG4CXX_STR("SOMEVALUE"), LOG4CXX_STR("somevalue"))){ // Do something with the 'value' here. diff --git a/src/main/include/log4cxx/private/aprserversocket.h b/src/main/include/log4cxx/private/aprserversocket.h index 761777942..1967cbd38 100644 --- a/src/main/include/log4cxx/private/aprserversocket.h +++ b/src/main/include/log4cxx/private/aprserversocket.h @@ -35,7 +35,7 @@ class LOG4CXX_EXPORT APRServerSocket : public helpers::ServerSocket void close() override; - SocketPtr accept(); + SocketPtr accept() override; private: struct APRServerSocketPriv; diff --git a/src/test/cpp/asyncappendertestcase.cpp b/src/test/cpp/asyncappendertestcase.cpp index 2bf7638fc..dedbded91 100644 --- a/src/test/cpp/asyncappendertestcase.cpp +++ b/src/test/cpp/asyncappendertestcase.cpp @@ -53,11 +53,11 @@ class NullPointerAppender : public AppenderSkeleton throw NullPointerException(LOG4CXX_STR("Intentional NullPointerException")); } - void close() + void close() override { } - bool requiresLayout() const + bool requiresLayout() const override { return false; } diff --git a/src/test/cpp/customlogger/xlogger.h b/src/test/cpp/customlogger/xlogger.h index 5d09c4374..916b61434 100644 --- a/src/test/cpp/customlogger/xlogger.h +++ b/src/test/cpp/customlogger/xlogger.h @@ -43,9 +43,9 @@ class XFactory : END_LOG4CXX_CAST_MAP() XFactory(); - virtual LoggerPtr makeNewLoggerInstance( + LoggerPtr makeNewLoggerInstance( log4cxx::helpers::Pool& pool, - const LogString& name) const; + const LogString& name) const override; }; typedef std::shared_ptr XFactoryPtr; diff --git a/src/test/cpp/net/smtpappendertestcase.cpp b/src/test/cpp/net/smtpappendertestcase.cpp index 2259b2208..a3ba3770b 100644 --- a/src/test/cpp/net/smtpappendertestcase.cpp +++ b/src/test/cpp/net/smtpappendertestcase.cpp @@ -52,7 +52,7 @@ class MockTriggeringEventEvaluator : { } - virtual bool isTriggeringEvent(const spi::LoggingEventPtr& event) + bool isTriggeringEvent(const spi::LoggingEventPtr& event) override { return true; } diff --git a/src/test/cpp/pattern/num343patternconverter.h b/src/test/cpp/pattern/num343patternconverter.h index ce3d81c3c..7ab63f0a8 100644 --- a/src/test/cpp/pattern/num343patternconverter.h +++ b/src/test/cpp/pattern/num343patternconverter.h @@ -35,7 +35,7 @@ class Num343PatternConverter : public LoggingEventPatternConverter void format( const log4cxx::spi::LoggingEventPtr& event, LogString& toAppendTo, - log4cxx::helpers::Pool& pool) const; + log4cxx::helpers::Pool& pool) const override; }; } } From c53235d4226a1bcb27acefaed2ea9aa7154de5a9 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Sun, 13 Nov 2022 16:02:37 +1100 Subject: [PATCH 17/17] Prevent Clang warning messages --- src/main/cpp/smtpappender.cpp | 2 +- src/main/cpp/syslogappender.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/cpp/smtpappender.cpp b/src/main/cpp/smtpappender.cpp index 42cd6ed32..e8ffcb489 100644 --- a/src/main/cpp/smtpappender.cpp +++ b/src/main/cpp/smtpappender.cpp @@ -365,7 +365,7 @@ class LOG4CXX_EXPORT DefaultEvaluator : has ERROR level or higher. Otherwise it returns false. */ - virtual bool isTriggeringEvent(const spi::LoggingEventPtr& event); + bool isTriggeringEvent(const spi::LoggingEventPtr& event) override; private: DefaultEvaluator(const DefaultEvaluator&); DefaultEvaluator& operator=(const DefaultEvaluator&); diff --git a/src/main/cpp/syslogappender.cpp b/src/main/cpp/syslogappender.cpp index 1de82236e..0743514da 100644 --- a/src/main/cpp/syslogappender.cpp +++ b/src/main/cpp/syslogappender.cpp @@ -423,6 +423,7 @@ void SyslogAppender::setSyslogHost(const LogString& syslogHost1) if (syslogHost1 != LOG4CXX_STR("localhost") && syslogHost1 != LOG4CXX_STR("127.0.0.1") && !syslogHost1.empty()) #endif + { if (slHostPort >= 0) { _priv->sw = std::make_unique(slHost, slHostPort); @@ -431,6 +432,7 @@ void SyslogAppender::setSyslogHost(const LogString& syslogHost1) { _priv->sw = std::make_unique(slHost); } + } _priv->syslogHost = slHost; _priv->syslogHostPort = slHostPort;