From 6c002e026645738e8cc23e3e1b3d2a631c7f2b3b Mon Sep 17 00:00:00 2001 From: trungnob Date: Fri, 19 May 2017 17:39:53 -0700 Subject: log: Moved print_system_info to log.cpp. We want to display syteminfo when the log system get initialized. Also removes a static block. --- host/lib/utils/log.cpp | 18 ++++++++++++++++++ host/lib/version.cpp | 11 ----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/host/lib/utils/log.cpp b/host/lib/utils/log.cpp index e850d1374..3bed85af7 100644 --- a/host/lib/utils/log.cpp +++ b/host/lib/utils/log.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -232,6 +233,23 @@ public: auto F = boost::make_shared(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); // Launch log message consumer _pop_task = std::make_shared(std::thread([this](){this->pop_task();})); diff --git a/host/lib/version.cpp b/host/lib/version.cpp index 2da261af0..2ba2dd0d6 100644 --- a/host/lib/version.cpp +++ b/host/lib/version.cpp @@ -21,17 +21,6 @@ #include #include -#ifndef UHD_DONT_PRINT_SYSTEM_INFO -UHD_STATIC_BLOCK(print_system_info){ - UHD_LOGGER_INFO("UHD") - << BOOST_PLATFORM << "; " - << BOOST_COMPILER << "; " - << "Boost_" << BOOST_VERSION << "; " - << "UHD_" << uhd::get_version_string() - ; -} -#endif - std::string uhd::get_version_string(void){ return "@UHD_VERSION@"; } -- cgit v1.2.3