diff options
author | trungnob <trung.n.tran@ni.com> | 2017-05-19 17:39:53 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-05-20 21:21:59 -0700 |
commit | 6c002e026645738e8cc23e3e1b3d2a631c7f2b3b (patch) | |
tree | 3499c533902526f9a96d249a186951ac837b118c | |
parent | 82f0d5a6d23c6b561a17a8fa15187118b7f35f14 (diff) | |
download | uhd-6c002e026645738e8cc23e3e1b3d2a631c7f2b3b.tar.gz uhd-6c002e026645738e8cc23e3e1b3d2a631c7f2b3b.tar.bz2 uhd-6c002e026645738e8cc23e3e1b3d2a631c7f2b3b.zip |
log: Moved print_system_info to log.cpp.
We want to display syteminfo when the log system get initialized.
Also removes a static block.
-rw-r--r-- | host/lib/utils/log.cpp | 18 | ||||
-rw-r--r-- | 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 <uhd/utils/static.hpp> #include <uhd/utils/paths.hpp> #include <uhd/transport/bounded_buffer.hpp> +#include <uhd/version.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/make_shared.hpp> #include <fstream> @@ -232,6 +233,23 @@ 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); // Launch log message consumer _pop_task = std::make_shared<std::thread>(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 <boost/version.hpp> #include <iostream> -#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@"; } |