RTI Distributed Logger API
Version 6.0.1
|
This module contains common definitions such as RTI Distributed Logger singleton, message sending functions, and general configuration. More...
Modules | |
RTI Distributed Logger Options API | |
Customize RTI Distributed Logger using this API. | |
RTI Distributed Logger Utility Module | |
Commodity functions to work with RTI Distributed Logger . | |
RTI Distributed Logger Version Module | |
Data Structures | |
struct | RTI_DL_DistLogger_MessageParams |
Input parameters for RTI_DL_DistLogger_logMessageWithParams. More... | |
struct | RTI_DL_DistLogger |
Struct defining RTI Distributed Logger singleton. More... | |
Functions | |
RTI_DL_DistLogger * | RTI_DL_DistLogger_getInstance () |
Provides access to the RTI_DL_DistLogger singleton. | |
DDS_ReturnCode_t | RTI_DL_DistLogger_setFilterLevel (RTI_DL_DistLogger *self, DDS_Long newLevel) |
Sets the filter level for the singleton. | |
RTIBool | RTI_DL_DistLogger_setOptions (RTI_DL_Options *options) |
Assigns configurable options to RTI Distributed Logger before its creation. | |
RTIBool | RTI_DL_DistLogger_setRTILoggerPrintFormat (RTI_DL_DistLogger *self, NDDS_Config_LogPrintFormat logPrintFormat) |
Sets PrintFormat of RTI Logger to the provided value. | |
void | RTI_DL_DistLogger_setRTILoggerVerbosityByCategory (RTI_DL_DistLogger *self, NDDS_Config_LogCategory category, NDDS_Config_LogVerbosity verbosity) |
Updates the LogCategory and the LogVerbosity in RTI Logger to the provided value. | |
void | RTI_DL_DistLogger_logMessageWithLevelCategory (RTI_DL_DistLogger *self, int logLevel, const char *message, const char *category) |
Logs a message at the specified level and with the specified category. | |
void | RTI_DL_DistLogger_logMessageWithParams (RTI_DL_DistLogger *self, const struct RTI_DL_DistLogger_MessageParams *params) |
Performs the same function as RTI_DL_DistLogger_logMessageWithLevelCategory except that it also allows specification of the message timestamp. | |
void | RTI_DL_DistLogger_fatal (RTI_DL_DistLogger *self, const char *message) |
Logs a fatal message. | |
void | RTI_DL_DistLogger_severe (RTI_DL_DistLogger *self, const char *message) |
Logs a severe message. | |
void | RTI_DL_DistLogger_error (RTI_DL_DistLogger *self, const char *message) |
Logs a error message. | |
void | RTI_DL_DistLogger_warning (RTI_DL_DistLogger *self, const char *message) |
Logs a warning message. | |
void | RTI_DL_DistLogger_notice (RTI_DL_DistLogger *self, const char *message) |
Logs a notice message. | |
void | RTI_DL_DistLogger_info (RTI_DL_DistLogger *self, const char *message) |
Logs a info message. | |
void | RTI_DL_DistLogger_debug (RTI_DL_DistLogger *self, const char *message) |
Logs a debug message. | |
void | RTI_DL_DistLogger_trace (RTI_DL_DistLogger *self, const char *message) |
Logs a trace message. | |
void | RTI_DL_DistLogger_log (RTI_DL_DistLogger *self, int logLevel, const char *message) |
Logs a message. | |
DDS_ReturnCode_t | RTI_DL_DistLogger_finalizeInstance () |
Finalizes and deletes the RTI Distributed Logger singleton. | |
This module contains common definitions such as RTI Distributed Logger singleton, message sending functions, and general configuration.
This module provides an API to publish log messages to a DDS Topic. Generally this API is used by an application logging infrastructure to integrate it into an application, although it is also possible to use the API directly. In general, the steps to customize and use RTI Distributed Logger are the following:
RTI_DL_DistLogger* RTI_DL_DistLogger_getInstance | ( | ) |
Provides access to the RTI_DL_DistLogger singleton.
This method provides access to the singleton instance of RTI Distributed Logger, RTI_DL_DistLogger. If the instance does not exist, it will be created. To customize it, use the RTI Distributed Logger Options API API BEFORE creating the singleton the first time. Note that no change in options is allowed after the singleton is created.
DDS_ReturnCode_t RTI_DL_DistLogger_setFilterLevel | ( | RTI_DL_DistLogger * | self, |
DDS_Long | newLevel | ||
) |
Sets the filter level for the singleton.
Filtering controls what type of log messages are sent. This enables filtering on the sending side (in the application using 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 Distributed Logger (file: <RTI Connext Installation Folder>/resource/idl/distlog.idl). The default value is RTI_DL_INFO_LEVEL.
In the IDL file, there are language-specific bindings. Prepend the appropriate binding to the filter level shown in the IDL. For example, one of the filter levels in the IDL is INFO_LEVEL. To refer to this filter level in C, use RTI_DL_INFO_LEVEL.
Log messages up to and including the specified filter level will pass through the filter and be sent on the network. For example, the WARNING level allows log messages up to and including the WARNING level (FATAL, SEVERE, ERROR, and WARNING) to be sent; any other log messages with numerically higher filter levels (INFO, DEBUG, and TRACE) will be filtered out and not sent.
[in,out] | self | Pointer to the RTI_DL_DistLogger |
[in] | newLevel | The new log level. |
The following table shows how RTI Connext DDS log levels (RTI Logger) map to RTI Distributed Logger log filter levels.
Not all Distributed Logger levels appear in this table because there is not a one-to-one mapping between RTI Connext DDS and RTI Distributed Logger levels (there are more levels in RTI Distributed Logger).
Connext DDS | Distributed Logger |
---|---|
NDDS_CONFIG_LOG_LEVEL_ERROR | RTI_DL_ERROR_LEVEL |
NDDS_CONFIG_LOG_LEVEL_WARNING | RTI_DL_WARNING_LEVEL |
NDDS_CONFIG_LOG_LEVEL_STATUS_LOCAL | RTI_DL_NOTICE_LEVEL |
NDDS_CONFIG_LOG_LEVEL_STATUS_REMOTE | RTI_DL_INFO_LEVEL |
NDDS_CONFIG_LOG_LEVEL_DEBUG | RTI_DL_DEBUG_LEVEL |
RTIBool RTI_DL_DistLogger_setOptions | ( | RTI_DL_Options * | options | ) |
Assigns configurable options to RTI Distributed Logger before its creation.
Assigns the values in the RTI_DL_Options struct to the RTI_DL_DistLogger singleton before its creation. If the singleton was already created, this function has no effect.
[in] | options | New options to be assigned to the RTI_DL_DistLogger singleton. |
RTIBool RTI_DL_DistLogger_setRTILoggerPrintFormat | ( | RTI_DL_DistLogger * | self, |
NDDS_Config_LogPrintFormat | logPrintFormat | ||
) |
Sets PrintFormat of RTI Logger to the provided value.
This method is mostly a pass-through to the appropriate call in the RTI Connext DDS library, but it also has the benefit of keeping the state of RTI Logger and RTI Distributed Logger in sync.
[in,out] | self | Pointer to the RTI_DL_DistLogger |
[in] | logPrintFormat | The new PrintFormat. |
void RTI_DL_DistLogger_setRTILoggerVerbosityByCategory | ( | RTI_DL_DistLogger * | self, |
NDDS_Config_LogCategory | category, | ||
NDDS_Config_LogVerbosity | verbosity | ||
) |
Updates the LogCategory and the LogVerbosity in RTI Logger to the provided value.
This method is mostly a pass-through to the appropriate call in the RTI Connext DDS library, but it also has the benefit of keeping the state of RTI Logger and RTI Distributed Logger in sync.
[in,out] | self | Pointer to the RTI_DL_DistLogger |
[in] | category | The category for which to set the verbosity. |
[in] | verbosity | The new verbosity level for the category. |
void RTI_DL_DistLogger_logMessageWithLevelCategory | ( | RTI_DL_DistLogger * | self, |
int | logLevel, | ||
const char * | message, | ||
const char * | category | ||
) |
Logs a message at the specified level and with the specified category.
[in] | self | Pointer to the RTI_DL_DistLogger |
[in] | logLevel | The level of the log message. |
[in] | message | The message to log. |
[in] | category | The category of the log message. |
void RTI_DL_DistLogger_logMessageWithParams | ( | RTI_DL_DistLogger * | self, |
const struct RTI_DL_DistLogger_MessageParams * | params | ||
) |
Performs the same function as RTI_DL_DistLogger_logMessageWithLevelCategory except that it also allows specification of the message timestamp.
[in] | self | Pointer to the RTI_DL_DistLogger |
[in] | params | Parameters. |
void RTI_DL_DistLogger_fatal | ( | RTI_DL_DistLogger * | self, |
const char * | message | ||
) |
Logs a fatal message.
The message received is logged using the default category and the RTI_DL_FATAL_LEVEL log level.
[in] | self | Pointer to the RTI_DL_DistLogger |
[in] | message | The message to log. |
void RTI_DL_DistLogger_severe | ( | RTI_DL_DistLogger * | self, |
const char * | message | ||
) |
Logs a severe message.
The message received is logged using the default category and the RTI_DL_SEVERE_LEVEL log level.
[in] | self | Pointer to the RTI_DL_DistLogger |
[in] | message | The message to log. |
void RTI_DL_DistLogger_error | ( | RTI_DL_DistLogger * | self, |
const char * | message | ||
) |
Logs a error message.
The message received is logged using the default category and the RTI_DL_ERROR_LEVEL log level.
[in] | self | Pointer to the RTI_DL_DistLogger |
[in] | message | The message to log. |
void RTI_DL_DistLogger_warning | ( | RTI_DL_DistLogger * | self, |
const char * | message | ||
) |
Logs a warning message.
The message received is logged using the default category and the RTI_DL_WARNING_LEVEL log level.
[in] | self | Pointer to the RTI_DL_DistLogger |
[in] | message | The message to log. |
void RTI_DL_DistLogger_notice | ( | RTI_DL_DistLogger * | self, |
const char * | message | ||
) |
Logs a notice message.
The message received is logged using the default category and the RTI_DL_NOTICE_LEVEL log level.
[in] | self | Pointer to the RTI_DL_DistLogger |
[in] | message | The message to log. |
void RTI_DL_DistLogger_info | ( | RTI_DL_DistLogger * | self, |
const char * | message | ||
) |
Logs a info message.
The message received is logged using the default category and the RTI_DL_INFO_LEVEL log level.
[in] | self | Pointer to the RTI_DL_DistLogger |
[in] | message | The message to log. |
void RTI_DL_DistLogger_debug | ( | RTI_DL_DistLogger * | self, |
const char * | message | ||
) |
Logs a debug message.
The message received is logged using the default category and the RTI_DL_DEBUG_LEVEL log level.
[in] | self | Pointer to the RTI_DL_DistLogger |
[in] | message | The message to log. |
void RTI_DL_DistLogger_trace | ( | RTI_DL_DistLogger * | self, |
const char * | message | ||
) |
Logs a trace message.
The message received is logged using the default category and the RTI_DL_TRACE_LEVEL log level.
[in] | self | Pointer to the RTI_DL_DistLogger |
[in] | message | The message to log. |
void RTI_DL_DistLogger_log | ( | RTI_DL_DistLogger * | self, |
int | logLevel, | ||
const char * | message | ||
) |
Logs a message.
The message received is logged using the default category and the given log level.
[in] | self | Pointer to the RTI_DL_DistLogger |
[in] | logLevel | The level of the log message. |
[in] | message | The message to log. |
DDS_ReturnCode_t RTI_DL_DistLogger_finalizeInstance | ( | ) |
Finalizes and deletes the RTI Distributed Logger singleton.
Unset the connections with DDS, free memory, and set the singleton to NULL