Index

Package: DDS.Logger

Description

package DDS.Logger is
(c) Copyright, Real-Time Innovations, 2025. All rights reserved. No duplications, whole or partial, manual or electronic, may be made without express written permission. Any such copies, or revisions thereof, must display this notice unaltered. This code contains trade secrets of Real-Time Innovations, Inc.

Classes

Ref

type Ref (<>) is new RTIDDS.Obj_Impl.Ref with private;

Primitive operations:

Get_Output_File
Get_Print_Format
Get_Verbosity
Get_Verbosity
GetInterface
Set_Output_Device
Set_Output_File
Set_Output_File_Name
Set_Output_File_Set
Set_Print_Format
Set_Verbosity
Set_Verbosity
SetInterface

Types

Ref_Access

type Ref_Access is access all Ref'Class;

LoggerDevice_Interface (abstract)

type LoggerDevice_Interface is limited interface;

LoggerDevice_Interface_Access

type LoggerDevice_Interface_Access is access all LoggerDevice_Interface'Class;

Subprograms & Entries

Get_Instance

function Get_Instance return Ref_Access;

Summary: Get the singleton instance of this type.

MT Safety:
UNSAFE. In VxWorks, it is unsafe to call this procedure while another thread may be simultaneously calling DDS.DomainParticipantFactory.get_instance, DDS.DomainParticipantFactory.finalize_instance, DDS_TypeCodeFactory.get_instance, DDSGuardCondition::DDSGuardCondition, DDSWaitSet::DDSWaitSet(), DDSWaitSet::DDSWaitSet(const DDS_WaitSetProperty_t&), DDSGuardCondition::~DDSGuardCondition, DDSWaitSet::~DDSWaitSet(), NDDSConfigLogger.get_instance, NDDSConfigLogger.get_output_device, NDDSConfigLogger.set_output_device, NDDSUtilityNetworkCapture.enable, or NDDSUtilityNetworkCapture.disable.

Get_Verbosity

function Get_Verbosity 
(This: not null access Ref) return LogVerbosity;

Summary: Get the verbosity at which RTI Connext is currently logging diagnostic information.

The default verbosity if NDDSConfigLogger.set_verbosity is never called is NDDS_CONFIG_LOG_VERBOSITY_ERROR.

If NDDSConfigLogger.set_verbosity_by_category has been used to set different verbosities for different categories of messages, this procedure will return the maximum verbosity of all categories.

Get_Verbosity

function Get_Verbosity 
(This: not null access Ref;
Category: in LogCategory) return LogVerbosity;

Summary: Get the verbosity at which RTI Connext is currently logging diagnostic information in the given category.

The default verbosity if NDDSConfigLogger.set_verbosity and NDDSConfigLogger.set_verbosity_by_category are never called is NDDS_CONFIG_LOG_VERBOSITY_ERROR.

Set_Verbosity

procedure Set_Verbosity 
(This: not null access Ref;
Verbosity: in LogVerbosity);

Summary: Set the verbosity at which RTI Connext will log diagnostic information.

Note: Logging at high verbosities will be detrimental to your application's performance. Your default setting should typically remain at NDDS_CONFIG_LOG_VERBOSITY_WARNING or below. (The default verbosity if you never set it is NDDS_CONFIG_LOG_VERBOSITY_ERROR.)

Set_Verbosity

procedure Set_Verbosity 
(This: not null access Ref;
Category: in LogCategory;
Verbosity: in LogVerbosity);

Summary: Set the verbosity at which RTI Connext will log diagnostic information in the given category.

Get_Print_Format

function Get_Print_Format 
(This: not null access Ref) return LogPrintFormat;

Summary: Get the current message format for the log level NDDS_CONFIG_LOG_LEVEL_ERROR.

Use NDDSConfigLogger.get_print_format_by_log_level to retrieve the format for other log levels.

If NDDSConfigLogger.set_print_format is never called, the default format is NDDS_CONFIG_LOG_PRINT_FORMAT_DEFAULT.

Set_Print_Format

procedure Set_Print_Format 
(This: not null access Ref;
Format: LogPrintFormat);

Summary: Set the message format that RTI Connext will use to log diagnostic information for all the log levels, except for NDDS_CONFIG_LOG_LEVEL_FATAL_ERROR. When the DDSActivityContextModule is printed, the user can select the information that will be part of the DDSActivityContextModule by using the API NDDSConfigActivityContext.set_attribute_mask.

Get_Output_File

function Get_Output_File 
(This: not null access Ref) return Interfaces.C_Streams.FILEs;
Get the file to which the logged output is redirected. If no output file has been registered through set_output_file, this function will return NULL. In this case, logged output will on most platforms go to standard out.

Set_Output_File

procedure Set_Output_File 
(This: not null access Ref;
To: Interfaces.C_Streams.FILEs);
Set the file to which the logged output is redirected. The file passed may be NULL, in which case further logged output will be redirected to the platform-specific default output location (standard out on most platforms). For better performance when log messages are generated frequently, the log messages are not flushed into a file immediately after they are generated. In other words, while writing a log message, RTI Connext only calls the function fwrite() (see https://pubs.opengroup.org/onlinepubs/009695399/functions/fwrite.html); it does not call the function fflush() (see https://pubs.opengroup.org/onlinepubs/009695399/functions/fflush.html). If your application requires a different flushing behavior, you may use set_output_device to configure a custom logging device.

Set_Output_File_Name

procedure Set_Output_File_Name 
(This: not null access Ref;
File_Name: Standard.String);
Set the name of the file to which the logged output is redirected. The name may be NULL, in which case further logged output will be redirected to the platform-specific default output location (standard out on most platforms). See output_file for the flushing behavior.

Set_Output_File_Set

procedure Set_Output_File_Set 
(This: not null access Ref;
File_Preffix: Standard.String;
File_Suffix: Standard.String;
Max_Capacity: Natural;
Max_Files: Natural);
Configure a set of files to redirect the logged output. The logged output will be redirected to a set of files whose names are configured with a prefix and a suffix. The maximum number of bytes configures how many bytes to write into a file before opening the next file. After reaching the maximum number of files, the first one is overwritten. For example, if the prefix is 'Foo', the suffix is '.txt', the max number of bytes is 1GB, and the max number of files is 3, the logger will create (at most) these files: Foo1.txt, Foo2.txt, and Foo3.txt. It will write to Foo1.txt, and after writing 1GB, it will move on to Foo2.txt, then to Foo3.txt, then to Foo1.txt again, and so on. To stop logging to these files and redirect the output to the platform-specific location, pass "", "", 0, 0.

Write (abstract)

procedure Write 
(Self: not null access LoggerDevice_Interface;
Text: Standard.String;
Level: LogVerbosity) is abstract;

Close

procedure Close 
(Self: not null access LoggerDevice_Interface) is null;

GetLogger (abstract)

function GetLogger 
(Self: access LoggerDevice_Interface) return DDS.Logger.Ref_Access is abstract;

Set_Output_Device

procedure Set_Output_Device 
(Self: not null access DDS.Logger.Ref;
Device: access LoggerDevice_Interface'Class);

GetDevice (abstract)

function GetDevice 
(Self: access LoggerDevice_Interface) return access RTIDDS.Low_Level.ndds_ndds_config_c_h.NDDS_Config_LoggerDevice is abstract;