From 9dddec48e7f5516e0c603d3eb540a169b50fa5a9 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 29 Mar 2018 16:36:29 -0700 Subject: rfnoc: Update logging in some blocks Updated the following blocks and components: Radio, DmaFIFO, block_ctrl_base and node_ctrl_base, blockdef_xml_impl, device3_impl. No functional changes. - Demoted some log messages - Consistent log style (use unique_id()) - Some adaptation of coding style where close to log statements --- host/lib/rfnoc/blockdef_xml_impl.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'host/lib/rfnoc/blockdef_xml_impl.cpp') diff --git a/host/lib/rfnoc/blockdef_xml_impl.cpp b/host/lib/rfnoc/blockdef_xml_impl.cpp index d8f749aa0..50faf6905 100644 --- a/host/lib/rfnoc/blockdef_xml_impl.cpp +++ b/host/lib/rfnoc/blockdef_xml_impl.cpp @@ -213,7 +213,9 @@ public: } } } catch (std::exception &e) { - UHD_LOGGER_WARNING("RFNOC") << "has_noc_id(): caught exception " << e.what() ; + UHD_LOGGER_WARNING("RFNOC") + << "has_noc_id(): caught exception " << e.what() + << " while parsing file: " << filename.string(); return false; } return false; @@ -223,7 +225,11 @@ public: _type(type), _noc_id(noc_id) { - //UHD_LOGGER_INFO("RFNOC") << "Reading XML file: " << filename.string().c_str() ; + UHD_LOGGER_DEBUG("RFNOC") << + boost::format("Reading XML file %s for NOC ID 0x%08X") + % filename.string().c_str() + % noc_id + ; read_xml(filename.string(), _pt); try { // Check key is valid @@ -352,7 +358,8 @@ public: arg["type"] = "string"; } if (not arg.is_valid()) { - UHD_LOGGER_WARNING("RFNOC") << boost::format("Found invalid argument: %s") % arg.to_string() ; + UHD_LOGGER_WARNING("RFNOC") + << "Found invalid argument: " << arg.to_string(); is_valid = false; } args.push_back(arg); @@ -408,15 +415,14 @@ blockdef::sptr blockdef::make_from_noc_id(uint64_t noc_id) std::vector valid; // Check if any of the paths exist - for(const fs::path &base_path: paths) { + for (const auto& base_path : paths) { fs::path this_path = base_path / XML_BLOCKS_SUBDIR; if (fs::exists(this_path) and fs::is_directory(this_path)) { valid.push_back(this_path); } } - if (valid.empty()) - { + if (valid.empty()) { throw uhd::assertion_error( "Failed to find a valid XML path for RFNoC blocks.\n" "Try setting the enviroment variable UHD_RFNOC_DIR " @@ -425,7 +431,7 @@ blockdef::sptr blockdef::make_from_noc_id(uint64_t noc_id) } // Iterate over all paths - for(const fs::path &path: valid) { + for (const auto& path : valid) { // Iterate over all .xml files fs::directory_iterator end_itr; for (fs::directory_iterator i(path); i != end_itr; ++i) { -- cgit v1.2.3