diff --git a/include/librealsense2/hpp/rs_internal.hpp b/include/librealsense2/hpp/rs_internal.hpp index 9936abeb98..323f9bd361 100644 --- a/include/librealsense2/hpp/rs_internal.hpp +++ b/include/librealsense2/hpp/rs_internal.hpp @@ -467,7 +467,7 @@ namespace rs2 void stop_collecting() { rs2_error * e = nullptr; - rs2_start_collecting_fw_logs( _dev.get(), &e ); + rs2_stop_collecting_fw_logs( _dev.get(), &e ); error::handle( e ); } diff --git a/src/fw-logs/fw-logs-parser.cpp b/src/fw-logs/fw-logs-parser.cpp index 8f5b3ee24b..e476b1572c 100644 --- a/src/fw-logs/fw-logs-parser.cpp +++ b/src/fw-logs/fw-logs-parser.cpp @@ -26,7 +26,7 @@ namespace librealsense { if( source.first >= fw_logs::max_sources ) throw librealsense::invalid_value_exception( rsutils::string::from() << "Supporting source id 0 to " - << fw_logs::max_sources << ". Found source (" + << fw_logs::max_sources - 1 << ". Found source (" << source.first << ", " << source.second << ")" ); initialize_source_formatting_options( source, definitions_xml ); @@ -193,7 +193,7 @@ namespace librealsense auto verbosity = fw_logs_xml_helper::get_source_module_verbosity( source.first, definitions_xml ); if( ! verbosity.empty() && verbosity.rbegin()->first >= fw_logs::max_modules ) throw librealsense::invalid_value_exception( rsutils::string::from() << "Supporting module id 0 to " - << fw_logs::max_modules << ". Found module " + << fw_logs::max_modules - 1 << ". Found module " << verbosity.rbegin()->first << " in source (" << source.first << ", " << source.second << ")" ); diff --git a/src/fw-logs/fw-logs-xml-helper.cpp b/src/fw-logs/fw-logs-xml-helper.cpp index ecb5cc3a75..618972b257 100644 --- a/src/fw-logs/fw-logs-xml-helper.cpp +++ b/src/fw-logs/fw-logs-xml-helper.cpp @@ -36,6 +36,8 @@ void load_external_xml( xml_document<> * document, std::vector< char > & buffer xml_node<> * get_first_node( const xml_document<> * document ) { xml_node<> * root = document->first_node(); + if( !root ) + throw librealsense::invalid_value_exception( "Cannot find XML root" ); std::string root_name( root->name(), root->name() + root->name_size() ); if( root_name.compare( "Format" ) != 0 ) @@ -150,7 +152,7 @@ std::string fw_logs_xml_helper::get_source_parser_file_path( int source_id, cons std::string path = get_file_path( source_node ); if( path.empty() ) throw librealsense::invalid_value_exception( rsutils::string::from() - << "Did not find 'File' attribute for source " << source_id ); + << "Did not find File 'Path' attribute for source " << source_id ); return path; } diff --git a/wrappers/python/pyrs_internal.cpp b/wrappers/python/pyrs_internal.cpp index d0793c6715..58989083a1 100644 --- a/wrappers/python/pyrs_internal.cpp +++ b/wrappers/python/pyrs_internal.cpp @@ -230,6 +230,7 @@ void init_internal(py::module &m) { firmware_log_parsed_message.def("get_message", &rs2::firmware_log_parsed_message::message, "Get message ") .def("get_file_name", &rs2::firmware_log_parsed_message::file_name, "Get file name ") .def("get_thread_name", &rs2::firmware_log_parsed_message::thread_name, "Get thread name ") + .def("get_module_name", &rs2::firmware_log_parsed_message::module_name, "Get module name ") .def("get_severity", &rs2::firmware_log_parsed_message::severity, "Get severity ") .def("get_line", &rs2::firmware_log_parsed_message::line, "Get line ") .def("get_timestamp", &rs2::firmware_log_parsed_message::timestamp, "Get timestamp ") @@ -240,11 +241,12 @@ void init_internal(py::module &m) { firmware_logger.def(py::init(), "device"_a) .def("create_message", &rs2::firmware_logger::create_message, "Create FW Log") .def("create_parsed_message", &rs2::firmware_logger::create_parsed_message, "Create FW Parsed Log") + .def("start_collecting", &rs2::firmware_logger::start_collecting, "Start collecting FW logs") + .def("stop_collecting", &rs2::firmware_logger::stop_collecting, "Stop collecting FW logs") .def("get_number_of_fw_logs", &rs2::firmware_logger::get_number_of_fw_logs, "Get Number of Fw Logs Polled From Device") .def("get_firmware_log", &rs2::firmware_logger::get_firmware_log, "Get FW Log", "msg"_a) .def("get_flash_log", &rs2::firmware_logger::get_flash_log, "Get Flash Log", "msg"_a) - .def("init_parser", &rs2::firmware_logger::init_parser, "Initialize Parser with content of xml file", - "xml_content"_a) + .def("init_parser", &rs2::firmware_logger::init_parser, "Initialize Parser with content of xml file", "xml_content"_a) .def("parse_log", &rs2::firmware_logger::parse_log, "Parse Fw Log ", "msg"_a, "parsed_msg"_a); // rs2::terminal_parser