Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/examples/cpp/custom-appender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,11 @@ class NullWriterAppender : public AppenderSkeleton {
return false;
}

void append( LOG4CXX_APPEND_FORMAL_PARAMETERS ) override {
void append( const spi::LoggingEventPtr& event ) override {
// This gets called whenever there is a valid event for our appender.
}

#if LOG4CXX_ABI_VERSION <= 15
void activateOptions(helpers::Pool& /* pool */) override {
#else
void activateOptions() override {
#endif
// Given all of our options, do something useful(e.g. open a file)
}

Expand Down
2 changes: 1 addition & 1 deletion src/fuzzers/cpp/PatternLayoutFuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class EncodingAppender : public AppenderSkeleton {
return true;
}

void append( LOG4CXX_APPEND_FORMAL_PARAMETERS ) override {
void append( const spi::LoggingEventPtr& event ) override {
LogString msg;
getLayout()->format(msg, event);
}
Expand Down
22 changes: 0 additions & 22 deletions src/main/cpp/action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,30 +81,8 @@ LogString Action::getName() const
return m_priv->actionName;
}

#if LOG4CXX_ABI_VERSION <= 15
bool Action::execute() const
{
helpers::Pool p;
return execute(p);
}

/**
* Capture exception.
*
* @param ex exception.
*/
void Action::reportException(const std::exception& /* ex */)
{
}

void Action::run(helpers::Pool&)
{
run();
}
#else
bool Action::execute(helpers::Pool&) const
{
return execute();
}

#endif
8 changes: 0 additions & 8 deletions src/main/cpp/appender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,7 @@ using namespace LOG4CXX_NS;

IMPLEMENT_LOG4CXX_OBJECT(Appender)

#if LOG4CXX_ABI_VERSION <= 15
void Appender::doAppend(const spi::LoggingEventPtr& event)
{
helpers::Pool p;
doAppend(event, p);
}
#else
void Appender::doAppend(const spi::LoggingEventPtr& event, helpers::Pool&)
{
doAppend(event);
}
#endif
12 changes: 0 additions & 12 deletions src/main/cpp/appenderattachableimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ AppenderAttachableImpl::AppenderAttachableImpl()
{
}

#if LOG4CXX_ABI_VERSION <= 15
AppenderAttachableImpl::AppenderAttachableImpl(Pool& pool)
: m_priv(std::make_unique<priv_data>())
{
}
#endif
AppenderAttachableImpl::~AppenderAttachableImpl()
{
}
Expand Down Expand Up @@ -112,12 +106,6 @@ int AppenderAttachableImpl::appendLoopOnAppenders(const spi::LoggingEventPtr& ev
}
return result;
}
#if LOG4CXX_ABI_VERSION <= 15
int AppenderAttachableImpl::appendLoopOnAppenders(const spi::LoggingEventPtr& event, helpers::Pool& p)
{
return appendLoopOnAppenders(event);
}
#endif

AppenderList AppenderAttachableImpl::getAllAppenders() const
{
Expand Down
23 changes: 5 additions & 18 deletions src/main/cpp/appenderskeleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,10 @@ AppenderSkeleton::AppenderSkeleton(const LayoutPtr& layout)

AppenderSkeleton::~AppenderSkeleton() {}

void AppenderSkeleton::activateOptions( LOG4CXX_ACTIVATE_OPTIONS_FORMAL_PARAMETERS )
void AppenderSkeleton::activateOptions( )
{
}

#if LOG4CXX_ABI_VERSION <= 15
void AppenderSkeleton::finalize()
{
// An appender might be closed then garbage collected. There is no
// point in closing twice.
if (m_priv->closed)
{
return;
}

close();
}
#endif

void AppenderSkeleton::addFilter(const spi::FilterPtr newFilter)
{
Expand Down Expand Up @@ -94,14 +81,14 @@ bool AppenderSkeleton::isAsSevereAsThreshold(const LevelPtr& level) const
return ((level == 0) || level->isGreaterOrEqual(m_priv->threshold));
}

void AppenderSkeleton::doAppend( LOG4CXX_APPEND_FORMAL_PARAMETERS )
void AppenderSkeleton::doAppend( const spi::LoggingEventPtr& event )
{
std::lock_guard<std::recursive_mutex> lock(m_priv->mutex);

doAppendImpl( LOG4CXX_APPEND_PARAMETERS );
doAppendImpl( event );
}

void AppenderSkeleton::doAppendImpl( LOG4CXX_APPEND_FORMAL_PARAMETERS )
void AppenderSkeleton::doAppendImpl( const spi::LoggingEventPtr& event )
{
if (m_priv->closed)
{
Expand All @@ -110,7 +97,7 @@ void AppenderSkeleton::doAppendImpl( LOG4CXX_APPEND_FORMAL_PARAMETERS )
}
else if (isAsSevereAsThreshold(event->getLevel()) && isAccepted(event))
{
append( LOG4CXX_APPEND_PARAMETERS );
append( event );
}
}

Expand Down
32 changes: 0 additions & 32 deletions src/main/cpp/aprinitializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
using namespace LOG4CXX_NS::helpers;
using namespace LOG4CXX_NS;

#if LOG4CXX_ABI_VERSION <= 15
bool APRInitializer::isDestructed = false;
#endif

using IdentifiedObject = std::pair<size_t, ObjectPtr>;

Expand Down Expand Up @@ -67,12 +64,6 @@ void tlsDestructImpl(void* ptr)
}
}

#if LOG4CXX_ABI_VERSION <= 15
extern "C" void tlsDestruct(void* ptr)
{
tlsDestructImpl(ptr);
}
#endif

namespace
{
Expand Down Expand Up @@ -105,20 +96,12 @@ APRInitializer::APRInitializer() :

APRInitializer::~APRInitializer()
{
#if LOG4CXX_ABI_VERSION <= 15
isDestructed = true;
#endif
#if APR_HAS_THREADS
std::lock_guard<std::mutex> lock(m_priv->mutex);
apr_threadkey_private_delete(m_priv->tlsKey);
#endif
}

#if LOG4CXX_ABI_VERSION <= 15
void APRInitializer::unregisterAll()
{
}
#endif

APRInitializer& APRInitializer::getInstance()
{
Expand All @@ -128,12 +111,6 @@ APRInitializer& APRInitializer::getInstance()
}


#if LOG4CXX_ABI_VERSION <= 15
log4cxx_time_t APRInitializer::initialize()
{
return getInstance().m_priv->startTime;
}
#endif

log4cxx_time_t APRInitializer::getStartTime()
{
Expand All @@ -150,15 +127,6 @@ apr_threadkey_t* APRInitializer::getTlsKey()
return getInstance().m_priv->tlsKey;
}

#if LOG4CXX_ABI_VERSION <= 15
void APRInitializer::registerCleanup(FileWatchdog* watchdog)
{
}

void APRInitializer::unregisterCleanup(FileWatchdog* watchdog)
{
}
#endif

void APRInitializer::addObject(size_t key, const ObjectPtr& pObject)
{
Expand Down
4 changes: 0 additions & 4 deletions src/main/cpp/aprserversocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ struct APRServerSocket::APRServerSocketPriv : public ServerSocketPrivate {
apr_pollset_t* pSet{ 0 };
};

#if LOG4CXX_ABI_VERSION <= 15
APRServerSocket::APRServerSocket(int port) :
APRServerSocket(port, false, {}) {}
#endif

APRServerSocket::APRServerSocket(int port, bool reuseAddress, const LogString& hostname) :
ServerSocket(std::make_unique<APRServerSocketPriv>()){
Expand Down
Loading
Loading