diff options
author | Marcus Müller <mmueller@gnuradio.org> | 2020-04-11 00:43:39 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2020-04-13 15:55:41 +0200 |
commit | 0f88db1ef0569bf6fcd5e9c843da38d487a6f54b (patch) | |
tree | 4c9827377c0e98fe223f39edb0c84c8a49c199e9 /gnuradio-runtime/lib/top_block_impl.cc | |
parent | ec8a92846a388cb0d2982822ea1961910cd552f8 (diff) |
runtime: replace stderr logging by calls to GR's logging facilties
Diffstat (limited to 'gnuradio-runtime/lib/top_block_impl.cc')
-rw-r--r-- | gnuradio-runtime/lib/top_block_impl.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gnuradio-runtime/lib/top_block_impl.cc b/gnuradio-runtime/lib/top_block_impl.cc index bfc2bf310f..393f8adbe5 100644 --- a/gnuradio-runtime/lib/top_block_impl.cc +++ b/gnuradio-runtime/lib/top_block_impl.cc @@ -15,6 +15,7 @@ #include "flat_flowgraph.h" #include "scheduler_tpb.h" #include "top_block_impl.h" +#include <gnuradio/logger.h> #include <gnuradio/prefs.h> #include <gnuradio/top_block.h> @@ -57,8 +58,12 @@ make_scheduler(flat_flowgraph_sptr ffg, int max_noutput_items, bool catch_except } } if (factory == 0) { - std::cerr << "warning: Invalid GR_SCHEDULER environment variable value \"" - << v << "\". Using \"" << scheduler_table[0].name << "\"\n"; + gr::logger_ptr logger, debug_logger; + gr::configure_default_loggers(logger, debug_logger, "top_block_impl"); + std::ostringstream msg; + msg << "Invalid GR_SCHEDULER environment variable value \"" << v + << "\". Using \"" << scheduler_table[0].name << "\""; + GR_LOG_WARN(logger, msg.str()); factory = scheduler_table[0].f; } } @@ -74,13 +79,16 @@ top_block_impl::top_block_impl(top_block* owner, bool catch_exceptions = true) d_retry_wait(false), d_catch_exceptions(catch_exceptions) { + gr::configure_default_loggers(d_logger, d_debug_logger, "top_block_impl"); } top_block_impl::~top_block_impl() { if (d_lock_count) { - std::cerr << "error: destroying locked block." << std::endl; + GR_LOG_ERROR(d_logger, "destroying locked block."); } + // NOTE: Investigate the sensibility of setting a raw pointer to zero at the end of + // destructor d_owner = 0; } |