| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
RTI® Log Parser is a command-line tool that processes and enhances RTI Connext® DDS log messages, making it easier to debug applications. You can find a quick-start guide in the tutorial folder.
You will need Python 2.7 or 3.x. Log Parser works in any OS that supports Python including Linux, Mac OS and Windows.
python rtilogparser -i <log_file>
The output is generated in Markdown format, which is easy to read in raw format while also allowing you to convert the output into HTML using viewers like Atom or dillinger.
Additional features can be enabled or disabled with the following arguments:
By default, any application built with Connext DDS will print the errors from the middleware to the standard output. In order to take advantage of Log Parser, we recommend enabling the higher log verbosity and redirecting the output into a file. There are several ways to increase the log verbosity:
<participant_factory_qos>
<logging>
<verbosity>ALL</verbosity>
<category>ALL</category>
<print_format>TIMESTAMPED</print_format>
<!-- Optional. Be careful if this QoS XML file is used by
different applications at the same time since more
than one could try to write the logs into the same file. -->
<output_file>ddslog.txt</output_file>
</logging>
</participant_factory_qos>// c
NDDS_Config_Logger_set_verbosity_by_category(
NDDS_Config_Logger_get_instance(),
NDDS_CONFIG_LOG_CATEGORY_ALL,
NDDS_CONFIG_LOG_VERBOSITY_STATUS_ALL);// c++
NDDSConfigLogger::get_instance()->set_verbosity_by_category(
NDDS_CONFIG_LOG_CATEGORY_ALL,
NDDS_CONFIG_LOG_VERBOSITY_STATUS_ALL);// c++03 and c++11
#include <rti/config/Logger.hpp>
rti::config::Logger::instance().verbosity_by_category(
rti::config::LogCategory::ALL_CATEGORIES,
rti::config::Verbosity::STATUS_ALL);// C#
NDDS.ConfigLogger.get_instance().set_verbosity_by_category(
NDDS.LogCategory.NDDS_CONFIG_LOG_CATEGORY_ALL,
NDDS.LogVerbosity.NDDS_CONFIG_LOG_VERBOSITY_STATUS_ALL);// Java
Logger.get_instance().set_verbosity_by_category(
LogCategory.NDDS_CONFIG_LOG_CATEGORY_ALL,
LogVerbosity.NDDS_CONFIG_LOG_VERBOSITY_STATUS_ALL);# Bash
export NDDS_QOS_PROFILES="str://\"<dds><qos_library name=\"myLoggingLib\"><qos_profile name=\"myLoggingProfile\" is_default_participant_factory_profile=\"true\"><participant_factory_qos><logging><verbosity>ALL</verbosity><category>ALL</category><print_format>TIMESTAMPED</print_format></logging></participant_factory_qos></qos_profile></qos_library></dds>\""
# Tcsh
setenv NDDS_QOS_PROFILES 'str://"<dds><qos_library name="myLoggingLib"><qos_profile name="myLoggingProfile" is_default_participant_factory_profile="true"><participant_factory_qos><logging><verbosity>ALL</verbosity><category>ALL</category><print_format>TIMESTAMPED</print_format></logging></participant_factory_qos></qos_profile></qos_library></dds>"'
# Windows CMD
set NDDS_QOS_PROFILES=str://"<dds><qos_library name="myLoggingLib"><qos_profile name="myLoggingProfile" is_default_participant_factory_profile="true"><participant_factory_qos><logging><verbosity>ALL</verbosity><category>ALL</category><print_format>TIMESTAMPED</print_format></logging></participant_factory_qos></qos_profile></qos_library></dds>"It is not necessary to compile Log Parser since it uses Python. Optionally, the source code can be zipped into a single file with create_redist.sh to simplify the distribution. The zip file can be executed as a .py file. For example: python rtilogparser -i log.txt.
Log Parser can be extended to parse custom log messages from an application. This can be done by adding a prefix to the log message or adding a new regular expression to Log Parser.
Any log message starting with #Custom: is parsed and will appear in the output with the prefix [APP].
Log Parser can be extended to implement custom parsers, by following these steps:
regex.append([custom.FUNCTION_NAME_TO_CALL_IF_MATCHED, LOG_REGEX])
def on_accept_data(match, state, logger):
# match is an array with the regular expression matched groups.
# state is a dictionary where you can store and retrieve variables.
# logger the logger that process the messages
seqnum = parse_sn(match[0])
logger.process("", "", "Reader accepted DATA (%d)" % seqnum, 1)| Back | FazBrowse Home | New Git URL |