RTI Connext Java API  Version 6.1.1

<<interface>> The singleton type used to configure RTI Connext logging. More...

Public Member Functions

LogVerbosity get_verbosity ()
 Get the verbosity at which RTI Connext is currently logging diagnostic information. More...
 
LogVerbosity get_verbosity_by_category (LogCategory category)
 Get the verbosity at which RTI Connext is currently logging diagnostic information in the given category. More...
 
void set_verbosity (LogVerbosity verbosity)
 Set the verbosity at which RTI Connext will log diagnostic information. More...
 
void set_verbosity_by_category (LogCategory category, LogVerbosity verbosity)
 Set the verbosity at which RTI Connext will log diagnostic information in the given category. More...
 
File get_output_file ()
 Get the file to which the logged output is redirected. More...
 
void set_output_file (File out) throws IOException
 Set the file to which the logged output is redirected. More...
 
void set_output_file_set (String file_prefix, String file_suffix, int max_capacity, int max_files) throws IOException
 Configure a set of files to redirect the logged output. More...
 
LoggerDevice get_output_device ()
 Return the user device registered with the logger. More...
 
void set_output_device (LoggerDevice device) throws IOException
 Register a com.rti.ndds.config.LoggerDevice. More...
 
LogPrintFormat get_print_format ()
 Get the current message format for the log level com.rti.ndds.config.LogLevel.NDDS_CONFIG_LOG_LEVEL_ERROR. More...
 
boolean set_print_format_by_log_level (LogPrintFormat print_format, LogLevel log_level)
 Set the message format, by log level, that RTI Connext will use to log diagnostic information. When the Activity Context is printed, the user can select the information that will be part of the Activity Context by using the API com.rti.ndds.config.ActivityContext.set_attribute_mask. More...
 
LogPrintFormat get_print_format_by_log_level (LogLevel log_level)
 Get the current message format, by log level, that RTI Connext is using to log diagnostic information. More...
 
boolean set_print_format (LogPrintFormat print_format)
 Set the message format that RTI Connext will use to log diagnostic information for all the log levels, except for com.rti.ndds.config.LogLevel.NDDS_CONFIG_LOG_LEVEL_FATAL_ERROR. When the Activity Context is printed, the user can select the information that will be part of the Activity Context by using the API com.rti.ndds.config.ActivityContext.set_attribute_mask. More...
 

Static Public Member Functions

static Logger get_instance ()
 Get the singleton instance of this type. More...
 

Detailed Description

<<interface>> The singleton type used to configure RTI Connext logging.

Member Function Documentation

◆ get_instance()

static Logger get_instance ( )
static

Get the singleton instance of this type.

References Logger.set_output_file(), and Logger.set_verbosity().

◆ get_verbosity()

LogVerbosity get_verbosity ( )

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

The default verbosity if com.rti.ndds.config.Logger.set_verbosity is never called is com.rti.ndds.config.LogVerbosity.NDDS_CONFIG_LOG_VERBOSITY_ERROR.

If com.rti.ndds.config.Logger.set_verbosity_by_category has been used to set different verbosities for different categories of messages, this method will return the maximum verbosity of all categories.

◆ get_verbosity_by_category()

LogVerbosity get_verbosity_by_category ( LogCategory  category)

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

The default verbosity if com.rti.ndds.config.Logger.set_verbosity and com.rti.ndds.config.Logger.set_verbosity_by_category are never called is com.rti.ndds.config.LogVerbosity.NDDS_CONFIG_LOG_VERBOSITY_ERROR.

References Enum.ordinal().

◆ set_verbosity()

void set_verbosity ( LogVerbosity  verbosity)

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 com.rti.ndds.config.LogVerbosity.NDDS_CONFIG_LOG_VERBOSITY_WARNING or below. (The default verbosity if you never set it is com.rti.ndds.config.LogVerbosity.NDDS_CONFIG_LOG_VERBOSITY_ERROR.)

References Enum.ordinal().

Referenced by Logger.get_instance().

◆ set_verbosity_by_category()

void set_verbosity_by_category ( LogCategory  category,
LogVerbosity  verbosity 
)

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

References Enum.ordinal().

◆ get_output_file()

File get_output_file ( )

Get the file to which the logged output is redirected.

If no output file has been registered through com.rti.ndds.config.Logger.set_output_file, this method will return NULL. In this case, logged output will on most platforms go to standard out as if through printf.

◆ set_output_file()

void set_output_file ( File  out) throws IOException

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 com.rti.ndds.config.Logger.set_output_device to configure a custom logging device.

Referenced by Logger.get_instance().

◆ set_output_file_set()

void set_output_file_set ( String  file_prefix,
String  file_suffix,
int  max_capacity,
int  max_files 
) throws IOException

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 NULL, NULL, 0, 0.

See com.rti.ndds.config.Logger.set_output_file for the flushing behavior.

◆ get_output_device()

LoggerDevice get_output_device ( )

Return the user device registered with the logger.

Returns
Registered user device or NULL if no user device is registered.

◆ set_output_device()

void set_output_device ( LoggerDevice  device) throws IOException

Register a com.rti.ndds.config.LoggerDevice.

Register the specified logging device with the logger.

There can be at most only one device registered with the logger at any given time.

When a device is installed, the logger will stop sending the log messages to the standard output and to the file set with com.rti.ndds.config.Logger.set_output_file.

To remove an existing device, use this method with NULL as the device parameter. After a device is removed the logger will continue sending log messages to the standard output and to the output file.

To replace an existing device with a new device, use this method providing the new device as the device parameter.

When a device is unregistered (by setting it to NULL), com.rti.ndds.config.LoggerDevice calls the method com.rti.ndds.config.LoggerDevice.close.

Parameters
device<<in>> Logging device.

◆ get_print_format()

LogPrintFormat get_print_format ( )

◆ set_print_format_by_log_level()

boolean set_print_format_by_log_level ( LogPrintFormat  print_format,
LogLevel  log_level 
)

Set the message format, by log level, that RTI Connext will use to log diagnostic information. When the Activity Context is printed, the user can select the information that will be part of the Activity Context by using the API com.rti.ndds.config.ActivityContext.set_attribute_mask.

References Enum.ordinal().

◆ get_print_format_by_log_level()

LogPrintFormat get_print_format_by_log_level ( LogLevel  log_level)

Get the current message format, by log level, that RTI Connext is using to log diagnostic information.

If com.rti.ndds.config.Logger.set_print_format is never called, the default format is com.rti.ndds.config.LogPrintFormat.NDDS_CONFIG_LOG_PRINT_FORMAT_DEFAULT.

References Enum.ordinal().

◆ set_print_format()

boolean set_print_format ( LogPrintFormat  print_format)

Set the message format that RTI Connext will use to log diagnostic information for all the log levels, except for com.rti.ndds.config.LogLevel.NDDS_CONFIG_LOG_LEVEL_FATAL_ERROR. When the Activity Context is printed, the user can select the information that will be part of the Activity Context by using the API com.rti.ndds.config.ActivityContext.set_attribute_mask.

References Enum.ordinal().