move build info to UE base class

This commit is contained in:
Andre Puschmann 2017-11-23 21:56:41 +01:00
parent d562a70261
commit 3ebda40580
3 changed files with 27 additions and 9 deletions

View File

@ -163,6 +163,10 @@ public:
srslte::log_filter rf_log; srslte::log_filter rf_log;
rf_metrics_t rf_metrics; rf_metrics_t rf_metrics;
srslte::LOG_LEVEL_ENUM level(std::string l); srslte::LOG_LEVEL_ENUM level(std::string l);
std::string get_build_mode();
std::string get_build_info();
std::string get_build_string();
}; };
} // namespace srsue } // namespace srsue

View File

@ -32,9 +32,6 @@
#include <string> #include <string>
#include <algorithm> #include <algorithm>
#include <iterator> #include <iterator>
#include <sstream>
#include <ue_base.h>
#include "srslte/build_info.h"
using namespace srslte; using namespace srslte;
@ -53,10 +50,6 @@ ue::~ue()
bool ue::init(all_args_t *args_) bool ue::init(all_args_t *args_)
{ {
std::stringstream ss;
ss << "Built in " << srslte_get_build_mode() << " mode using " << srslte_get_build_info() << "." << std::endl << std::endl;
std::cout << ss.str();
args = args_; args = args_;
if (!args->log.filename.compare("stdout")) { if (!args->log.filename.compare("stdout")) {
@ -64,7 +57,7 @@ bool ue::init(all_args_t *args_)
} else { } else {
logger_file.init(args->log.filename); logger_file.init(args->log.filename);
logger_file.log("\n\n"); logger_file.log("\n\n");
logger_file.log(ss.str().c_str()); logger_file.log(get_build_string().c_str());
logger = &logger_file; logger = &logger_file;
} }

View File

@ -24,13 +24,14 @@
* *
*/ */
#include "ue_base.h" #include "ue_base.h"
#include "ue.h" #include "ue.h"
#include "srslte/srslte.h" #include "srslte/srslte.h"
#include "srslte/build_info.h"
#include <pthread.h> #include <pthread.h>
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <sstream>
#include <algorithm> #include <algorithm>
#include <iterator> #include <iterator>
@ -58,6 +59,9 @@ ue_base* ue_base::get_instance(srsue_instance_type_t type)
} }
ue_base::ue_base() { ue_base::ue_base() {
// print build info
std::cout << std::endl << get_build_string() << std::endl;
// load FFTW wisdom // load FFTW wisdom
srslte_dft_load(); srslte_dft_load();
} }
@ -116,4 +120,21 @@ srslte::LOG_LEVEL_ENUM ue_base::level(std::string l)
} }
} }
std::string ue_base::get_build_mode()
{
return std::string(srslte_get_build_mode());
}
std::string ue_base::get_build_info()
{
return std::string(srslte_get_build_info());
}
std::string ue_base::get_build_string()
{
std::stringstream ss;
ss << "Built in " << get_build_mode() << " mode using " << get_build_info() << "." << std::endl;
return ss.str();
}
} // namespace srsue } // namespace srsue