Skip to content

Commit

Permalink
Use override keyword.
Browse files Browse the repository at this point in the history
  • Loading branch information
wilx committed Dec 23, 2023
1 parent 3dc3ff1 commit 76b5093
Show file tree
Hide file tree
Showing 17 changed files with 96 additions and 98 deletions.
12 changes: 6 additions & 6 deletions include/log4cplus/asyncappender.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ class LOG4CPLUS_EXPORT AsyncAppender
public:
AsyncAppender (SharedAppenderPtr const & app, unsigned max_len);
AsyncAppender (helpers::Properties const &);

AsyncAppender (AsyncAppender const &) = delete;
AsyncAppender & operator = (AsyncAppender const &) = delete;

virtual ~AsyncAppender ();

virtual void close ();
virtual void close () override;

protected:
virtual void append (spi::InternalLoggingEvent const &);
virtual void append (spi::InternalLoggingEvent const &) override;

void init_queue_thread (unsigned);

thread::AbstractThreadPtr queue_thread;
thread::QueuePtr queue;

private:
AsyncAppender (AsyncAppender const &);
AsyncAppender & operator = (AsyncAppender const &);
};


Expand Down
4 changes: 2 additions & 2 deletions include/log4cplus/callbackappender.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ class LOG4CPLUS_EXPORT CallbackAppender
CallbackAppender(const log4cplus::helpers::Properties&);

virtual ~CallbackAppender();
virtual void close();
virtual void close() override;

void setCookie(void *);
void setCallback(log4cplus_log_event_callback_t);

protected:
virtual void append(const log4cplus::spi::InternalLoggingEvent& event);
virtual void append(const log4cplus::spi::InternalLoggingEvent& event) override;

private:
log4cplus_log_event_callback_t callback;
Expand Down
24 changes: 12 additions & 12 deletions include/log4cplus/clfsappender.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
//
//
// Copyright (C) 2012-2017, Vaclav Zeman. All rights reserved.
//
//
// Redistribution and use in source and binary forms, with or without modifica-
// tion, are permitted provided that the following conditions are met:
//
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
//
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
Expand All @@ -27,8 +27,8 @@
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


//

/** @file */
Expand Down Expand Up @@ -67,25 +67,25 @@ class LOG4CPLUS_CLFSAPPENDER_EXPORT CLFSAppender
CLFSAppender (tstring const & logname, unsigned long logsize,
unsigned long buffersize);
explicit CLFSAppender (helpers::Properties const &);

CLFSAppender (CLFSAppender const &) = delete;
CLFSAppender & operator = (CLFSAppender const &) = delete;

virtual ~CLFSAppender ();

virtual void close ();
virtual void close () override;

static void registerAppender ();

protected:
virtual void append (spi::InternalLoggingEvent const &);
virtual void append (spi::InternalLoggingEvent const &) override;

void init (tstring const & logname, unsigned long logsize,
unsigned long buffersize);

struct Data;

Data * data;

private:
CLFSAppender (CLFSAppender const &);
CLFSAppender & operator = (CLFSAppender const &);
};


Expand Down
10 changes: 5 additions & 5 deletions include/log4cplus/consoleappender.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace log4cplus {
* <dt><tt>ImmediateFlush</tt></dt>
* <dd>When it is set true, output stream will be flushed after
* each appended event.</dd>
*
*
* <dt><tt>Locale</tt></dt>
* <dd>This property specifies a locale name that will be imbued
* into output stream. Locale can be specified either by system
Expand All @@ -61,11 +61,11 @@ namespace log4cplus {
* <code>spi::LocaleFactory</code> in
* <code>spi::LocaleFactoryRegistry</code>.
* \sa spi::getLocaleFactoryRegistry().
*
*
* Note: if <tt>Locale</tt> is set, <tt>ImmediateFlush</tt> will
* be set to true automatically.
* </dd>
*
*
* </dl>
* \sa Appender
*/
Expand All @@ -79,14 +79,14 @@ namespace log4cplus {
~ConsoleAppender();

// Methods
virtual void close();
virtual void close() override;

//! This mutex is used by ConsoleAppender and helpers::LogLog
//! classes to synchronize output to console.
static log4cplus::thread::Mutex const & getOutputMutex();

protected:
virtual void append(const spi::InternalLoggingEvent& event);
virtual void append(const spi::InternalLoggingEvent& event) override;

// Data
bool logToStdErr;
Expand Down
16 changes: 8 additions & 8 deletions include/log4cplus/fileappender.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ namespace log4cplus
class LOG4CPLUS_EXPORT FileAppenderBase : public Appender {
public:
// Methods
virtual void close();
virtual void close() override;

//! Redefine default locale for output stream. It may be a good idea to
//! provide UTF-8 locale in case UNICODE macro is defined.
Expand All @@ -137,7 +137,7 @@ namespace log4cplus

void init();

virtual void append(const spi::InternalLoggingEvent& event);
virtual void append(const spi::InternalLoggingEvent& event) override;

virtual void open(std::ios_base::openmode mode);
bool reopen();
Expand Down Expand Up @@ -253,7 +253,7 @@ namespace log4cplus
virtual ~RollingFileAppender();

protected:
virtual void append(const spi::InternalLoggingEvent& event);
virtual void append(const spi::InternalLoggingEvent& event) override;
void rollover(bool alreadyLocked = false);

// Data
Expand Down Expand Up @@ -324,10 +324,10 @@ namespace log4cplus
virtual ~DailyRollingFileAppender();

// Methods
virtual void close();
virtual void close() override;

protected:
virtual void append(const spi::InternalLoggingEvent& event);
virtual void append(const spi::InternalLoggingEvent& event) override;
void rollover(bool alreadyLocked = false);
log4cplus::helpers::Time calculateNextRolloverTime(const log4cplus::helpers::Time& t) const;
log4cplus::tstring getFilename(const log4cplus::helpers::Time& t) const;
Expand Down Expand Up @@ -398,9 +398,9 @@ namespace log4cplus
~TimeBasedRollingFileAppender();

protected:
void append(const spi::InternalLoggingEvent& event);
void open(std::ios_base::openmode mode);
void close();
virtual void append(const spi::InternalLoggingEvent& event) override;
void open(std::ios_base::openmode mode) override;
virtual void close() override;
void rollover(bool alreadyLocked = false);
void clean(helpers::Time time);
helpers::Time::duration getRolloverPeriodDuration() const;
Expand Down
6 changes: 3 additions & 3 deletions include/log4cplus/layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ namespace log4cplus {
virtual ~SimpleLayout();

virtual void formatAndAppend(log4cplus::tostream& output,
const log4cplus::spi::InternalLoggingEvent& event);
const log4cplus::spi::InternalLoggingEvent& event) override;

private:
// Disallow copying of instances of this class
Expand Down Expand Up @@ -172,7 +172,7 @@ namespace log4cplus {
virtual ~TTCCLayout();

virtual void formatAndAppend(log4cplus::tostream& output,
const log4cplus::spi::InternalLoggingEvent& event);
const log4cplus::spi::InternalLoggingEvent& event) override;

bool getThreadPrinting() const;
void setThreadPrinting(bool);
Expand Down Expand Up @@ -623,7 +623,7 @@ namespace log4cplus {
virtual ~PatternLayout();

virtual void formatAndAppend(log4cplus::tostream& output,
const log4cplus::spi::InternalLoggingEvent& event);
const log4cplus::spi::InternalLoggingEvent& event) override;

protected:
void init(const log4cplus::tstring& pattern, unsigned ndcMaxDepth = 0);
Expand Down
4 changes: 2 additions & 2 deletions include/log4cplus/log4judpappender.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ namespace log4cplus {
~Log4jUdpAppender();

// Methods
virtual void close();
virtual void close() override;

protected:
void openSocket();
virtual void append(const spi::InternalLoggingEvent& event);
virtual void append(const spi::InternalLoggingEvent& event) override;

// Data
log4cplus::helpers::Socket socket;
Expand Down
4 changes: 2 additions & 2 deletions include/log4cplus/msttsappender.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ class LOG4CPLUS_MSTTSAPPENDER_EXPORT MSTTSAppender
explicit MSTTSAppender (helpers::Properties const &);
virtual ~MSTTSAppender ();

virtual void close ();
virtual void close () override;

static void registerAppender ();

protected:
virtual void append (spi::InternalLoggingEvent const &);
virtual void append (spi::InternalLoggingEvent const &) override;

struct Data;

Expand Down
18 changes: 8 additions & 10 deletions include/log4cplus/nteventlogappender.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,27 @@
namespace log4cplus {

/**
* Appends log events to NT EventLog.
* Appends log events to NT EventLog.
*/
class LOG4CPLUS_EXPORT NTEventLogAppender : public Appender {
public:
// ctors
NTEventLogAppender(const log4cplus::tstring& server,
const log4cplus::tstring& log,
NTEventLogAppender(const log4cplus::tstring& server,
const log4cplus::tstring& log,
const log4cplus::tstring& source);
NTEventLogAppender(const log4cplus::helpers::Properties & properties);

NTEventLogAppender(const NTEventLogAppender&) = delete;
NTEventLogAppender& operator=(const NTEventLogAppender&) = delete;

// dtor
virtual ~NTEventLogAppender();

// public Methods
virtual void close();
virtual void close() override;

protected:
virtual void append(const spi::InternalLoggingEvent& event);
virtual void append(const spi::InternalLoggingEvent& event) override;
virtual WORD getEventType(const spi::InternalLoggingEvent& event);
virtual WORD getEventCategory(const spi::InternalLoggingEvent& event);
void init();
Expand All @@ -71,11 +74,6 @@ namespace log4cplus {
log4cplus::tstring source;
HANDLE hEventLog;
SID* pCurrentUserSID;

private:
// Disallow copying of instances of this class
NTEventLogAppender(const NTEventLogAppender&);
NTEventLogAppender& operator=(const NTEventLogAppender&);
};

} // end namespace log4cplus
Expand Down
6 changes: 3 additions & 3 deletions include/log4cplus/nullappender.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
namespace log4cplus {

/**
* Appends log events to a file.
* Appends log events to a file.
*/
class LOG4CPLUS_EXPORT NullAppender : public Appender {
public:
Expand All @@ -48,10 +48,10 @@ namespace log4cplus {
virtual ~NullAppender();

// Methods
virtual void close();
virtual void close() override;

protected:
virtual void append(const log4cplus::spi::InternalLoggingEvent& event);
virtual void append(const log4cplus::spi::InternalLoggingEvent& event) override;

private:
// Disallow copying of instances of this class
Expand Down
12 changes: 6 additions & 6 deletions include/log4cplus/qt4debugappender.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ class LOG4CPLUS_QT4DEBUGAPPENDER_EXPORT Qt4DebugAppender
explicit Qt4DebugAppender (helpers::Properties const &);
virtual ~Qt4DebugAppender ();

virtual void close ();
Qt4DebugAppender (Qt4DebugAppender const &) = delete;
Qt4DebugAppender & operator = (Qt4DebugAppender const &) = delete;


virtual void close () override;

static void registerAppender ();

protected:
virtual void append (spi::InternalLoggingEvent const &);

private:
Qt4DebugAppender (Qt4DebugAppender const &);
Qt4DebugAppender & operator = (Qt4DebugAppender const &);
virtual void append (spi::InternalLoggingEvent const &) override;
};


Expand Down
12 changes: 6 additions & 6 deletions include/log4cplus/qt5debugappender.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@ class LOG4CPLUS_QT5DEBUGAPPENDER_EXPORT Qt5DebugAppender
public:
Qt5DebugAppender ();
explicit Qt5DebugAppender (helpers::Properties const &);

Qt5DebugAppender (Qt5DebugAppender const &) = delete;
Qt5DebugAppender & operator = (Qt5DebugAppender const &) = delete;

virtual ~Qt5DebugAppender ();

virtual void close ();
virtual void close () override;

static void registerAppender ();

protected:
virtual void append (spi::InternalLoggingEvent const &);

private:
Qt5DebugAppender (Qt5DebugAppender const &);
Qt5DebugAppender & operator = (Qt5DebugAppender const &);
virtual void append (spi::InternalLoggingEvent const &) override;
};


Expand Down
Loading

0 comments on commit 76b5093

Please sign in to comment.