From ec7144d6466e560b00223fb3bb72d31b38a038da Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 31 May 2018 15:31:59 -0700 Subject: rfnoc: Warn when a block key is not found in the registry Before, a block description file could specify a block controlley key which was not mapped to a registered block controller, and it would fall back to the default. While that behaviour is desired, it was lacking a warning when it made that decision. --- host/lib/rfnoc/block_ctrl_base_factory.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/host/lib/rfnoc/block_ctrl_base_factory.cpp b/host/lib/rfnoc/block_ctrl_base_factory.cpp index 3f3f52ac6..554db5acf 100644 --- a/host/lib/rfnoc/block_ctrl_base_factory.cpp +++ b/host/lib/rfnoc/block_ctrl_base_factory.cpp @@ -11,8 +11,6 @@ #include #include -#define UHD_FACTORY_LOG() UHD_LOGGER_TRACE("RFNOC") - using namespace uhd; using namespace uhd::rfnoc; @@ -61,7 +59,7 @@ block_ctrl_base::sptr block_ctrl_base::make( const make_args_t &make_args_, uint64_t noc_id ) { - UHD_FACTORY_LOG() << "[RFNoC Factory] block_ctrl_base::make() " ; + UHD_LOGGER_TRACE("RFNOC") << "[RFNoC Factory] block_ctrl_base::make()"; make_args_t make_args = make_args_; // Check if a block key was specified, in this case, we *must* either @@ -74,13 +72,18 @@ block_ctrl_base::sptr block_ctrl_base::make( ); } if (not get_block_fcn_regs().has_key(make_args.block_key)) { + UHD_LOG_WARNING("RFNOC", + "Can't find a block controller for key " << make_args.block_key + << ", using default block controller!"); make_args.block_key = DEFAULT_BLOCK_NAME; } if (make_args.block_name.empty()) { make_args.block_name = make_args.block_key; } - UHD_FACTORY_LOG() << "[RFNoC Factory] Using controller key '" << make_args.block_key << "' and block name '" << make_args.block_name << "'" ; + UHD_LOGGER_TRACE("RFNOC") + << "[RFNoC Factory] Using controller key '" << make_args.block_key + << "' and block name '" << make_args.block_name << "'"; return get_block_fcn_regs()[make_args.block_key](make_args); } -- cgit v1.2.3