diff options
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/utils/log.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/host/lib/utils/log.cpp b/host/lib/utils/log.cpp index 58341b9b6..a29c275a8 100644 --- a/host/lib/utils/log.cpp +++ b/host/lib/utils/log.cpp @@ -204,16 +204,7 @@ public: << "Boost_" << BOOST_VERSION << "; " << "UHD_" << uhd::get_version_string(); - auto sys_info_log_msg = uhd::log::logging_info( - pt::microsec_clock::local_time(), - uhd::log::info, - __FILE__, - __LINE__, - "UHD", - boost::this_thread::get_id() - ); - sys_info_log_msg.message = sys_info.str(); - _log_queue.push_with_timed_wait(sys_info_log_msg, 0.25); + _publish_log_msg(sys_info.str(), uhd::log::info, "UHD"); } // Launch log message consumer @@ -421,6 +412,23 @@ private: } } + void _publish_log_msg( + const std::string& msg, + const uhd::log::severity_level level=uhd::log::info, + const std::string& component="LOGGING" + ) { + auto log_msg = uhd::log::logging_info( + pt::microsec_clock::local_time(), + level, + __FILE__, + __LINE__, + component, + boost::this_thread::get_id() + ); + log_msg.message = msg; + _log_queue.push_with_timed_wait(log_msg, 0.25); + } + std::mutex _logmap_mutex; std::atomic<bool> _exit; using level_logfn_pair = |