From c1a91d140919518de18eda1fd5b598b2c11ef0cd Mon Sep 17 00:00:00 2001 From: Marcus Müller <mmueller@gnuradio.org> Date: Mon, 13 Apr 2020 18:24:43 +0200 Subject: runtime: move loggers from gr::block to gr::basic_block No reason to assume only `general_work`-containing blocks would want to log. This enables us especially to log in `basic_block` itself. --- gnuradio-runtime/lib/basic_block.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gnuradio-runtime/lib/basic_block.cc') diff --git a/gnuradio-runtime/lib/basic_block.cc b/gnuradio-runtime/lib/basic_block.cc index f86051213c..c6ac346d11 100644 --- a/gnuradio-runtime/lib/basic_block.cc +++ b/gnuradio-runtime/lib/basic_block.cc @@ -39,6 +39,7 @@ basic_block::basic_block(const std::string& name, d_rpc_set(false), d_message_subscribers(pmt::make_dict()) { + configure_default_loggers(d_logger, d_debug_logger, d_symbol_name); s_ncurrently_allocated++; } @@ -177,7 +178,9 @@ void basic_block::insert_tail(pmt::pmt_t which_port, pmt::pmt_t msg) if ((msg_queue.find(which_port) == msg_queue.end()) || (msg_queue_ready.find(which_port) == msg_queue_ready.end())) { - std::cout << "target port = " << pmt::symbol_to_string(which_port) << std::endl; + GR_LOG_ERROR(d_logger, + std::string("attempted insertion on invalid queue ") + + pmt::symbol_to_string(which_port)); throw std::runtime_error("attempted to insert_tail on invalid queue!"); } -- cgit v1.2.3