Controlling Messages from Connext DDS

Connext DDS provides several types of messages to help you debug your system and alert you to errors during run time. You can control how much information is reported and where it is logged.

How much information is logged is known as the verbosity setting. Message Logging Verbosity Levels describes the increasing verbosity levels.

Message Logging Verbosity Levels

Verbosity (NDDS_CONFIG_
LOG_VERBOSITY_*)

Description

SILENT

No messages will be logged. (lowest verbosity)

ERROR (default level for all categories)

Log only high-priority error messages. An error indicates something is wrong with how Connext DDS is functioning. The most common cause of this type of error is an incorrect configuration.

WARNING

Additionally log warning messages. A warning indicates that Connext DDS is taking an action that may or may not be what you intended. Some configuration information is also logged at this verbosity to aid in debugging.

STATUS_LOCAL

Additionally log verbose information about the lifecycles of local Connext DDS objects.

STATUS_REMOTE

Additionally log verbose information about the lifecycles of remote Connext DDS objects.

STATUS_ALL

Additionally log verbose information about periodic activities and Connext DDS threads. (highest verbosity)

Note that the verbosities are cumulative: logging at a high verbosity means also logging all lower verbosity messages. If you change nothing, the default verbosity will be set to NDDS_CONFIG_LOG_VERBOSITY_ERROR.

Logging at high verbosities can be detrimental to your application's performance. You should generally not set the verbosity above NDDS_CONFIG_LOG_VERBOSITY_WARNING, unless you are debugging a specific problem.

You will typically change the verbosity of all of Connext DDS at once. However, in the event that such a strategy produces too much output, you can further discriminate among the messages you would like to see. The types of messages logged by Connext DDS fall into the categories listed in Message Logging Categories; each category can be set to a different verbosity level.

Message Logging Categories

Category (NDDS_CONFIG_
LOG_CATEGORY_*)

Description

PLATFORM

Messages about the underlying platform (hardware and OS).

COMMUNICATION

Messages about data serialization and deserialization and network traffic.

DATABASE

Messages about the internal database of Connext DDS objects.

ENTITIES

Messages about local and remote entities and the discovery process.

API

Messages about Connext DDS’s API layer (such as method argument validation).

The methods in the NDDSConfigLogger class can be used to change verbosity settings, as well as the destination for logged messages. NDDSConfigLogger Operations lists the available operations; consult the API Reference HTML documentation for more information.

NDDSConfigLogger Operations

Purpose

Operation

Description

Change Verbosity for all Categories

get_verbosity

Gets the current verbosity.

If per-category verbosities are used, returns the highest verbosity of any
category.

set_verbosity

Sets the verbosity of all categories.

Change Verbosity for a Specific Category

get_verbosity_by_category

Gets/Sets the verbosity for a specific category.

set_verbosity_by_category

Change Destination of Logged Messages

get_output_file

Returns the file to which messages are being logged, or NULL for the default destination (standard output on most platforms).

set_output_file

Redirects future logged messages to a set of files.

get_output_device

Returns the logging device installed with the logger.

set_output_device

Registers a specified logging device with the logger. See Customizing the Handling of Generated Log Messages

Change Message Format

get_print_format

Gets/Sets the current message format that Connext DDS is using to log diagnostic information. See Format of Logged Messages.

set_print_format

© 2018 RTI