diff --git a/src/logging.cpp b/src/logging.cpp index e09c3fd..cf521fa 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -24,6 +24,10 @@ string toString(LogLevel level) { PausableBackendAdapter::PausableBackendAdapter(boost::shared_ptr backend) : backend(backend) {} +PausableBackendAdapter::~PausableBackendAdapter() { + resume(); +} + void PausableBackendAdapter::consume(const record_view& recordView, const string message) { lock_guard lock(mutex); if (isPaused) { diff --git a/src/logging.h b/src/logging.h index 03f2b83..cc717c8 100644 --- a/src/logging.h +++ b/src/logging.h @@ -46,6 +46,7 @@ class PausableBackendAdapter : { public: PausableBackendAdapter(boost::shared_ptr backend); + ~PausableBackendAdapter(); void consume(const boost::log::record_view& recordView, const std::string message); void pause(); void resume();