diff options
author | Martin Braun <martin.braun@ettus.com> | 2018-01-18 12:31:34 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-01-18 12:32:05 -0800 |
commit | 3a995b35532307930e2a999c551ffa2ab17ffbe6 (patch) | |
tree | c3a0cb54fea35947a1beccfd909fb56369932328 /host/lib/utils | |
parent | e504e6d9943186ba4d963ed977cbdb461bead755 (diff) | |
download | uhd-3a995b35532307930e2a999c551ffa2ab17ffbe6.tar.gz uhd-3a995b35532307930e2a999c551ffa2ab17ffbe6.tar.bz2 uhd-3a995b35532307930e2a999c551ffa2ab17ffbe6.zip |
logging: Fix version print at top of every UHD session
Diffstat (limited to 'host/lib/utils')
-rw-r--r-- | host/lib/utils/log.cpp | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/host/lib/utils/log.cpp b/host/lib/utils/log.cpp index 2e10bc6a3..0dd06e99c 100644 --- a/host/lib/utils/log.cpp +++ b/host/lib/utils/log.cpp @@ -222,23 +222,27 @@ public: auto F = boost::make_shared<file_logger_backend>(log_file_target); _loggers[UHD_FILE_LOGGER_KEY] = [F](const uhd::log::logging_info& log_info){F->log(log_info);}; } - std::ostringstream sys_info; - sys_info \ - << "UHD" \ - << BOOST_PLATFORM << "; " - << BOOST_COMPILER << "; " - << "Boost_" - << BOOST_VERSION << "; " - << "UHD_" << uhd::get_version_string(); - _log_queue.push_with_timed_wait( - uhd::log::logging_info( - pt::microsec_clock::local_time(), - uhd::log::info, - __FILE__, - __LINE__, - sys_info.str(), - boost::this_thread::get_id()), - 0.25); + + // On boot, we print the current UHD version info: + { + std::ostringstream sys_info; + sys_info \ + << BOOST_PLATFORM << "; " + << BOOST_COMPILER << "; " + << "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); + } // Launch log message consumer _pop_task = std::make_shared<std::thread>(std::thread([this](){this->pop_task();})); |