RTI Connext Traditional C++ API
Version 5.3.0
|
<<interface>> The singleton type used to configure RTI Connext logging. More...
Public Member Functions | |
NDDS_Config_LogVerbosity | get_verbosity () |
Get the verbosity at which RTI Connext is currently logging diagnostic information. | |
NDDS_Config_LogVerbosity | get_verbosity_by_category (NDDS_Config_LogCategory category) |
Get the verbosity at which RTI Connext is currently logging diagnostic information in the given category. | |
void | set_verbosity (NDDS_Config_LogVerbosity verbosity) |
Set the verbosity at which RTI Connext will log diagnostic information. | |
void | set_verbosity_by_category (NDDS_Config_LogCategory category, NDDS_Config_LogVerbosity verbosity) |
Set the verbosity at which RTI Connext will log diagnostic information in the given category. | |
FILE * | get_output_file () |
Get the file to which the logged output is redirected. | |
bool | set_output_file (FILE *out) |
Set the file to which the logged output is redirected. | |
bool | set_output_file_set (const char *file_prefix, const char *file_suffix, int max_capacity, int max_files) |
Configure a set of files to redirect the logged output. | |
NDDSConfigLoggerDevice * | get_output_device () |
Return the user device registered with the logger. | |
bool | set_output_device (NDDSConfigLoggerDevice *device) |
Register a NDDSConfigLoggerDevice. | |
NDDS_Config_LogPrintFormat | get_print_format () |
Get the current message format that RTI Connext is using to log diagnostic information. | |
bool | set_print_format (NDDS_Config_LogPrintFormat print_format) |
Set the message format that RTI Connext will use to log diagnostic information. | |
Static Public Member Functions | |
static NDDSConfigLogger * | get_instance () |
Get the singleton instance of this type. | |
static void | finalize_instance () |
Finalize the singleton instance of this type. | |
<<interface>> The singleton type used to configure RTI Connext logging.
|
static |
Get the singleton instance of this type.
|
static |
Finalize the singleton instance of this type.
NDDS_Config_LogVerbosity NDDSConfigLogger::get_verbosity | ( | ) |
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 method will return the maximum verbosity of all categories.
NDDS_Config_LogVerbosity NDDSConfigLogger::get_verbosity_by_category | ( | NDDS_Config_LogCategory | category | ) |
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.
void NDDSConfigLogger::set_verbosity | ( | NDDS_Config_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 NDDS_CONFIG_LOG_VERBOSITY_WARNING or below. (The default verbosity if you never set it is NDDS_CONFIG_LOG_VERBOSITY_ERROR.)
void NDDSConfigLogger::set_verbosity_by_category | ( | NDDS_Config_LogCategory | category, |
NDDS_Config_LogVerbosity | verbosity | ||
) |
Set the verbosity at which RTI Connext will log diagnostic information in the given category.
FILE* NDDSConfigLogger::get_output_file | ( | ) |
Get the file to which the logged output is redirected.
If no output file has been registered through NDDSConfigLogger::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.
bool NDDSConfigLogger::set_output_file | ( | FILE * | out | ) |
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).
bool NDDSConfigLogger::set_output_file_set | ( | const char * | file_prefix, |
const char * | file_suffix, | ||
int | max_capacity, | ||
int | max_files | ||
) |
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.
NDDSConfigLoggerDevice* NDDSConfigLogger::get_output_device | ( | ) |
Return the user device registered with the logger.
bool NDDSConfigLogger::set_output_device | ( | NDDSConfigLoggerDevice * | device | ) |
Register a NDDSConfigLoggerDevice.
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 NDDSConfigLogger::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), NDDSConfigLoggerDevice calls the method NDDSConfigLoggerDevice::close.
device | <<in>> Logging device. |
NDDS_Config_LogPrintFormat NDDSConfigLogger::get_print_format | ( | ) |
Get the current message format that RTI Connext is using to log diagnostic information.
If NDDSConfigLogger::set_print_format is never called, the default format is NDDS_CONFIG_LOG_PRINT_FORMAT_DEFAULT.
bool NDDSConfigLogger::set_print_format | ( | NDDS_Config_LogPrintFormat | print_format | ) |
Set the message format that RTI Connext will use to log diagnostic information.