X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Flogging.cpp;h=ab0594c342e5b58a0d7bf63ec91693640adbba50;hp=9740690e7f33e87364a4a915c22499127b3f0cc2;hb=72486b789078f024e4f3404f81118c03b03e2b70;hpb=37134086132e66d102d465a50536c31a32b2cf0c diff --git a/pv/logging.cpp b/pv/logging.cpp index 9740690e..ab0594c3 100644 --- a/pv/logging.cpp +++ b/pv/logging.cpp @@ -28,6 +28,8 @@ #include +using std::lock_guard; + namespace pv { Logging logging; @@ -72,7 +74,9 @@ int Logging::get_log_level() const void Logging::set_log_level(int level) { sr_log_loglevel_set(level); +#ifdef ENABLE_DECODE srd_log_loglevel_set(level); +#endif } QString Logging::get_log() const @@ -82,6 +86,8 @@ QString Logging::get_log() const void Logging::log(const QString &text, int source) { + lock_guard log_lock(log_mutex_); + if (buffer_.size() >= buffer_size_) buffer_.removeFirst();