Making sure log is written in case of exception
This commit is contained in:
parent
933f324943
commit
419b0ec469
|
@ -24,6 +24,10 @@ string toString(LogLevel level) {
|
|||
PausableBackendAdapter::PausableBackendAdapter(boost::shared_ptr<text_ostream_backend> backend) :
|
||||
backend(backend) {}
|
||||
|
||||
PausableBackendAdapter::~PausableBackendAdapter() {
|
||||
resume();
|
||||
}
|
||||
|
||||
void PausableBackendAdapter::consume(const record_view& recordView, const string message) {
|
||||
lock_guard<std::mutex> lock(mutex);
|
||||
if (isPaused) {
|
||||
|
|
|
@ -46,6 +46,7 @@ class PausableBackendAdapter :
|
|||
{
|
||||
public:
|
||||
PausableBackendAdapter(boost::shared_ptr<boost::log::sinks::text_ostream_backend> backend);
|
||||
~PausableBackendAdapter();
|
||||
void consume(const boost::log::record_view& recordView, const std::string message);
|
||||
void pause();
|
||||
void resume();
|
||||
|
|
Loading…
Reference in New Issue