RTI Distributed Logger Modern C++ API Version 7.2.0
rti::dist_logger::DistLoggerOptions Class Reference

This class contains RTI Distributed Logger configurable options. More...

#include <rti/distlogger/DistLoggerOptions.hpp>

Public Member Functions

dds::domain::DomainParticipant domain_participant () const
 Gets currently set Domain Participant. More...
 
void domain_participant (const dds::domain::DomainParticipant &domain_participant)
 Sets current Domain Participant. More...
 
bool remote_administration_enabled () const
 Indicates whether or not remote administration is enabled. More...
 
void remote_administration_enabled (bool enabled)
 Enables or disables remote administration. More...
 
int filter_level () const
 Gets the log filter level. More...
 
void filter_level (int filter_level)
 Sets the log filter level. More...
 
int domain_id () const
 Gets the current Domain ID. More...
 
void domain_id (int domain_id)
 Sets the current Domain ID. More...
 
rti::core::optional_value< std::string > qos_library () const
 Gets the Qos Library that will be used to create to RTI Distributed Logger. More...
 
void qos_library (const rti::core::optional_value< std::string > &qos_library)
 Sets the Qos Library that will be used to create to RTI Distributed Logger. More...
 
rti::core::optional_value< std::string > qos_profile () const
 Gets the Qos Profile that will be used to create to RTI Distributed Logger. More...
 
void qos_profile (const rti::core::optional_value< std::string > &qos_profile)
 Sets the Qos Profile that will be used to create to RTI Distributed Logger. More...
 
int queue_size () const
 Gets the maximum queue size that will be assigned to RTI Distributed Logger. More...
 
void queue_size (int queue_size)
 Sets the maximum queue size that will be assigned to RTI Distributed Logger. More...
 
rti::core::ThreadSettings thread_settings () const
 Get the thread settings of the publishing thread that will be created by RTI Distributed Logger. More...
 
void thread_settings (const rti::core::ThreadSettings &thread_settings)
 Sets the settings of the publishing thread that will be created by RTI Distributed Logger. More...
 
rti::core::optional_value< std::string > application_kind () const
 Gets the application kind that will be associated with RTI Distributed Logger. More...
 
void application_kind (const rti::core::optional_value< std::string > &application_kind)
 Sets the application kind that will be associated with RTI Distributed Logger. More...
 
bool echo_to_stdout () const
 Indicates whether this feature is enabled. More...
 
void echo_to_stdout (bool echo_to_stdout)
 Enables or disables this feature. More...
 
bool log_infrastructure_messages () const
 Indicates whether Distributed Logger should also log all messages produced by infrastructure code automatically. More...
 
void log_infrastructure_messages (bool log)
 Enables or disables automatic logging of infrastructure messages. More...
 
bool operator== (const DistLoggerOptions &other) const
 Compares two objects for equality. More...
 
bool operator!= (const DistLoggerOptions &other) const
 Compares two objects for inequality. More...
 

Friends

void swap (DistLoggerOptions &left, DistLoggerOptions &right) noexcept
 Swaps two objects. More...
 

Detailed Description

This class contains RTI Distributed Logger configurable options.

Use this API to customize RTI Distributed Logger to adapt it to your needs. Assign the newly created DistLoggerOptions object to the RTI Distributed Logger singleton before calling to DistLogger::get_instance().

Member Function Documentation

◆ domain_participant() [1/2]

dds::domain::DomainParticipant rti::dist_logger::DistLoggerOptions::domain_participant ( ) const

Gets currently set Domain Participant.

Returns
The current Domain Participant if set. Otherwise, dds::core::null.

◆ domain_participant() [2/2]

void rti::dist_logger::DistLoggerOptions::domain_participant ( const dds::domain::DomainParticipant &  domain_participant)

Sets current Domain Participant.

There are several use cases in which you may want to use your own Domain Participant to create RTI Distributed Logger internal DDS entities. By calling this function, you will have control of the Domain Participant used by RTI Distributed Logger. Once assigned, domain_participant will be used to create the DDS entities (Topics, Publishers, Subscribers, DataWriters, & DataReaders) needed by RTI Distributed Logger. If domain_participant is set, the associated Distributed Logger instance must be finalized before finalizing the Domain Participant Factory.

Parameters
domain_participantThe dds::domain::DomainParticipant to use.

◆ remote_administration_enabled() [1/2]

bool rti::dist_logger::DistLoggerOptions::remote_administration_enabled ( ) const

Indicates whether or not remote administration is enabled.

If true, remote administration Topics will be created and used. If false, they will not be created. The default value is true.

Returns
true if remote administration is enabled. Otherwise false.

◆ remote_administration_enabled() [2/2]

void rti::dist_logger::DistLoggerOptions::remote_administration_enabled ( bool  enabled)

Enables or disables remote administration.

Sets remote administration of the Topics to the value passed as parameter.

Parameters
enabledA bool indicating whether or not to enable remote administration.

◆ filter_level() [1/2]

int rti::dist_logger::DistLoggerOptions::filter_level ( ) const

Gets the log filter level.

Supported Filter Levels: See the IDL file provided with RTI Distributed Logger (<RTI Connext Installation Folder>/resource/idl/distlog.idl). The default value is RTI_DL_INFO_LEVEL.

Returns
integer containing the log filter level of the options.

◆ filter_level() [2/2]

void rti::dist_logger::DistLoggerOptions::filter_level ( int  filter_level)

Sets the log filter level.

Filtering controls what type of log messages are sent. This enables filtering on the sending side (in the application using RTI Distributed Logger). You can also enable filtering on the receiving side (such as in a tool that receives log messages, like RTI Admin Console or RTI Monitor).

Supported Filter Levels: See the IDL file provided with RTI Distributed Logger (<RTI Connext Installation Folder>/resource/idl/distlog.idl). The default value is RTI_DL_INFO_LEVEL.

Parameters
filter_levelThe log filter level of the options (see above).

◆ domain_id() [1/2]

int rti::dist_logger::DistLoggerOptions::domain_id ( ) const

Gets the current Domain ID.

Returns the Domain ID to be used by RTI Distributed Logger. This value is only used if a Domain Participant has not been set. Otherwise, the Domain ID used is the one of the set Domain Participant

The default value is 0.

Returns
Integer containing the DDS Domain ID where RTI Distributed Logger instance will be created.

◆ domain_id() [2/2]

void rti::dist_logger::DistLoggerOptions::domain_id ( int  domain_id)

Sets the current Domain ID.

Update the Domain ID to be used by RTI Distributed Logger. This value is only used if a Domain Participant has not been set. Otherwise, the Domain ID used is the one of the set Domain Participant.

The default value is 0.

Parameters
domain_idInt representing a DDS Domain ID. Max value: 250

◆ qos_library() [1/2]

rti::core::optional_value< std::string > rti::dist_logger::DistLoggerOptions::qos_library ( ) const

Gets the Qos Library that will be used to create to RTI Distributed Logger.

The QoS library name to use when creating DDS entities. It is up to the application to ensure that this library is available at run time for the Distributed Logger to use.

Returns
rti::core::optional_value<std::string> containing the current Qos Library.

◆ qos_library() [2/2]

void rti::dist_logger::DistLoggerOptions::qos_library ( const rti::core::optional_value< std::string > &  qos_library)

Sets the Qos Library that will be used to create to RTI Distributed Logger.

The QoS Library name to use when creating DDS entities. It is up to the application to ensure that this library is available at run time for the Distributed Logger to use.

Parameters
qos_libraryrti::core::optional_value<std::string> containing the Qos Library to set.

◆ qos_profile() [1/2]

rti::core::optional_value< std::string > rti::dist_logger::DistLoggerOptions::qos_profile ( ) const

Gets the Qos Profile that will be used to create to RTI Distributed Logger.

The QoS Profile name to use when creating DDS entities. It is up to the application to ensure that this profile is available at run time for the Distributed Logger to use.

Returns
rti::core::optional_value<std::string> containing the current Qos Profile.

◆ qos_profile() [2/2]

void rti::dist_logger::DistLoggerOptions::qos_profile ( const rti::core::optional_value< std::string > &  qos_profile)

Sets the Qos Profile that will be used to create to RTI Distributed Logger.

The QoS Profile name to use when creating DDS entities. It is up to the application to ensure that this profile is available at run time for the Distributed Logger to use.

Parameters
qos_profilerti::core::optional_value<std::string> containing the Qos Profile to set.

◆ queue_size() [1/2]

int rti::dist_logger::DistLoggerOptions::queue_size ( ) const

Gets the maximum queue size that will be assigned to RTI Distributed Logger.

This field controls the size of the queue used to temporarily store log messages from the application until they can be written out to DDS. The default value is RTI_DL_DEFAULT_QUEUE_SIZE.

Returns
Integer containing the current maximum queue size.

◆ queue_size() [2/2]

void rti::dist_logger::DistLoggerOptions::queue_size ( int  queue_size)

Sets the maximum queue size that will be assigned to RTI Distributed Logger.

This field controls the size of the queue used to temporarily store log messages from the application until they can be written out to DDS.

Parameters
queue_sizeInteger containing the new maximum queue size.

◆ thread_settings() [1/2]

rti::core::ThreadSettings rti::dist_logger::DistLoggerOptions::thread_settings ( ) const

Get the thread settings of the publishing thread that will be created by RTI Distributed Logger.

This field contains general settings of the publishing thread in Distributed Logger, like the thread priority, stack size, and other settings.

Returns
The currently set rti::core::ThreadSettings

◆ thread_settings() [2/2]

void rti::dist_logger::DistLoggerOptions::thread_settings ( const rti::core::ThreadSettings &  thread_settings)

Sets the settings of the publishing thread that will be created by RTI Distributed Logger.

This parameter is used to control thread parameters such as priority, stack size, and other settings. These settings will only affect the publishing thread created by RTI Distributed Logger.

Parameters
thread_settingsA valid rti::core::ThreadSettings object with the settings for Distributed Logger's write thread.

◆ application_kind() [1/2]

rti::core::optional_value< std::string > rti::dist_logger::DistLoggerOptions::application_kind ( ) const

Gets the application kind that will be associated with RTI Distributed Logger.

This char pointer is sent along on the state Topic and can help identify different applications within a system. You can use this field however you think it will help you most.

Returns
rti::core::optional_value<std::string> containing the current application kind.

◆ application_kind() [2/2]

void rti::dist_logger::DistLoggerOptions::application_kind ( const rti::core::optional_value< std::string > &  application_kind)

Sets the application kind that will be associated with RTI Distributed Logger.

This string is sent along on the state Topic and can help identify different applications within a system. You can use this field however you think it will help you most.

Parameters
application_kindrti::core::optional_value<std::string> containing the new application kind.

◆ echo_to_stdout() [1/2]

bool rti::dist_logger::DistLoggerOptions::echo_to_stdout ( ) const

Indicates whether this feature is enabled.

If true, Distributed Logger prints the log messages received to the stdout. The default value is true.

Returns
true if echo_to_stdout is enabled. Otherwise false.

◆ echo_to_stdout() [2/2]

void rti::dist_logger::DistLoggerOptions::echo_to_stdout ( bool  echo_to_stdout)

Enables or disables this feature.

If true, Distributed Logger prints the log messages received to the stdout. The default value is true.

Parameters
echo_to_stdoutA bool indicating whether or not to enable this feature.

◆ log_infrastructure_messages() [1/2]

bool rti::dist_logger::DistLoggerOptions::log_infrastructure_messages ( ) const

Indicates whether Distributed Logger should also log all messages produced by infrastructure code automatically.

If true, messages produced by either the middleware or the tools will be forwarded to Distributed Logger.

Returns
true if log_infrastructure_messages is enabled. Otherwise false.

◆ log_infrastructure_messages() [2/2]

void rti::dist_logger::DistLoggerOptions::log_infrastructure_messages ( bool  log)

Enables or disables automatic logging of infrastructure messages.

If true, messages produced by either the middleware or the tools will be forwarded to Distributed Logger. In this mode Distributed Logger uses NDDS_Config_Logger_set_output_device() API to receive messages from the middleware. Hence any device previously registered with the rti::config::Logger::set_device() API will be unregistered. Similarly Distributed Logger will stop logging infrastructure messages if the set_device() API is used to register a new device after the creation of the Distributed Logger instance.

Parameters
logbool indicating whether or not to enable this feature.

◆ operator==()

bool rti::dist_logger::DistLoggerOptions::operator== ( const DistLoggerOptions other) const

Compares two objects for equality.

Parameters
otherThe other object to compare.

◆ operator!=()

bool rti::dist_logger::DistLoggerOptions::operator!= ( const DistLoggerOptions other) const

Compares two objects for inequality.

Parameters
otherThe other object to compare.

Friends And Related Function Documentation

◆ swap

void swap ( DistLoggerOptions left,
DistLoggerOptions right 
)
friend

Swaps two objects.

Parameters
leftOne of the objects to swap.
rightThe other object to swap.