From 9830730918ee9b93d9ed14bb53074ed02355ef4e Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 20 Apr 2017 16:20:52 -0700 Subject: log: Allow logging to block This means it's very unlikely that logging messages get dropped, but the downside is that LOG macros can block for up to 250 ms. This is very unlikely though. Note that fastpath logging does not have this feature. It's always fast, and might drop messages. --- host/lib/utils/log.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/host/lib/utils/log.cpp b/host/lib/utils/log.cpp index 10baaf3f4..78c02a4c5 100644 --- a/host/lib/utils/log.cpp +++ b/host/lib/utils/log.cpp @@ -253,7 +253,8 @@ public: void push(const uhd::log::logging_info& log_info) { - _log_queue.push_with_haste(log_info); + static const double PUSH_TIMEOUT = 0.25; // seconds + _log_queue.push_with_timed_wait(log_info, PUSH_TIMEOUT); } void push_fastpath(const std::string &message) -- cgit v1.2.3