RTI Distributed Logger API
Version 6.1.2
|
This class contains RTI Distributed Logger singleton and the methods to configure and use it. More...
Public Member Functions | |
DDS_ReturnCode_t | setFilterLevel (DDS_Long newLevel) |
Sets the filter level for the singleton. More... | |
bool | setRTILoggerPrintFormat (NDDS_Config_LogPrintFormat logPrintFormat) |
Sets PrintFormat of RTI Logger to the provided value. More... | |
void | setRTILoggerVerbosityByCategory (NDDS_Config_LogCategory category, NDDS_Config_LogVerbosity verbosity) |
Updates the LogCategory and the LogVerbosity in RTI Logger to the provided value. More... | |
void | logMessageWithLevelCategory (int logLevel, const char *message, const char *category) |
Logs a message at the specified level and with the specified category. More... | |
void | logMessageWithParams (const struct RTI_DL_DistLogger_MessageParams ¶ms) |
Performs the same function as logMessageWithLevelCategory except that it also allows specification of the message timestamp. More... | |
void | fatal (const char *message) |
Logs a fatal message. More... | |
void | severe (const char *message) |
Logs a severe message. More... | |
void | error (const char *message) |
Logs a error message. More... | |
void | warning (const char *message) |
Logs a warning message. More... | |
void | notice (const char *message) |
Logs a notice message. More... | |
void | info (const char *message) |
Logs a info message. More... | |
void | debug (const char *message) |
Logs a debug message. More... | |
void | trace (const char *message) |
Logs a trace message. More... | |
void | log (int logLevel, const char *message) |
Logs a message. More... | |
void | finalizeInstance () |
Finalizes and delete the RTI_DL_DistLogger singleton. More... | |
DDS_Long | getFatalLogLevel () |
Return Fatal log level. More... | |
DDS_Long | getErrorLogLevel () |
Return Error log level. More... | |
DDS_Long | getWarningLogLevel () |
Return Warning log level. More... | |
DDS_Long | getNoticeLogLevel () |
Return Notice log level. More... | |
DDS_Long | getInfoLogLevel () |
Return Info log level. More... | |
DDS_Long | getDebugLogLevel () |
Return Debug log level. More... | |
Static Public Member Functions | |
static RTI_DLDistLogger * | getInstance () |
Provides access to the RTI_DL_DistLogger singleton. More... | |
static bool | setOptions (RTI_DLOptions &options) |
Assigns configurable options to RTI Distributed Logger before its creation. More... | |
This class contains RTI Distributed Logger singleton and the methods to configure and use it.
This class is a singleton, so only one copy will be created. Use the RTI_DLOptions class to customize the singleton BEFORE creating it.
|
static |
Provides access to the RTI_DL_DistLogger singleton.
This method provides access to the singleton instance of the RTI_DL_DistLogger. If the instance does not exist, it will be created. Note that no change in options is allowed after the singleton is created.
DDS_ReturnCode_t RTI_DLDistLogger::setFilterLevel | ( | 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 table below. The default value is RTI_DL_INFO_LEVEL. The default value is RTI_DL_INFO_LEVEL.
Or see the IDL file provided with Distributed Logger (file: <RTI Connext Installation Folder>/resource/idl/distlog.idl).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] | newLevel | The new filter level. |
The following table shows how RTI Connext DDS log levels map to RTI Distributed Logger log filter levels.
Not all RTI 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). You can obtain the filter level using a constant defined in the Distributed Logger IDL file or a getter function in the Distributed Logger API.
Connext DDS API constant | Distributed Logger IDL constant | Distributed Logger API getter |
---|---|---|
NDDS_CONFIG_LOG_FATAL_ERROR | RTI_DL_FATAL_LEVEL | getFatalLogLevel |
NDDS_CONFIG_LOG_LEVEL_ERROR | RTI_DL_ERROR_LEVEL | getErrorLogLevel |
NDDS_CONFIG_LOG_LEVEL_WARNING | RTI_DL_WARNING_LEVEL | getWarningLogLevel |
NDDS_CONFIG_LOG_LEVEL_STATUS_LOCAL | RTI_DL_NOTICE_LEVEL | getNoticeLogLevel |
NDDS_CONFIG_LOG_LEVEL_STATUS_REMOTE | RTI_DL_INFO_LEVEL | getInfoLogLevel |
NDDS_CONFIG_LOG_LEVEL_DEBUG | RTI_DL_DEBUG_LEVEL | getDebugLogLevel |
|
static |
Assigns configurable options to RTI Distributed Logger before its creation.
Assigns the values in the options
to the RTI_DLDistLogger singleton before its creation. If the singleton was already created, this function has no effect.
[in] | options | The new options to be assigned to the RTI_DLDistLogger singleton. |
bool RTI_DLDistLogger::setRTILoggerPrintFormat | ( | 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 RTI DDS library, but it also has the benefit of keeping the state of RTI Logger and RTI Distributed Logger in sync.
[in] | logPrintFormat | The new PrintFormat. |
void RTI_DLDistLogger::setRTILoggerVerbosityByCategory | ( | 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 RTI DDS library, but it also has the benefit of keeping the state of RTI Logger and RTI Distributed Logger in sync.
[in] | category | The category for which to set the verbosity. |
[in] | verbosity | The new verbosity level for the category. |
void RTI_DLDistLogger::logMessageWithLevelCategory | ( | int | logLevel, |
const char * | message, | ||
const char * | category | ||
) |
Logs a message at the specified level and with the specified category.
[in] | logLevel | The level of the log message. |
[in] | message | The message to log. |
[in] | category | The category of the log message. |
void RTI_DLDistLogger::logMessageWithParams | ( | const struct RTI_DL_DistLogger_MessageParams & | params | ) |
Performs the same function as logMessageWithLevelCategory except that it also allows specification of the message timestamp.
[in] | params | Parameters. |
void RTI_DLDistLogger::fatal | ( | 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] | message | The message to log. |
void RTI_DLDistLogger::severe | ( | 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] | message | The message to log. |
void RTI_DLDistLogger::error | ( | 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] | message | The message to log. |
void RTI_DLDistLogger::warning | ( | 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] | message | The message to log. |
void RTI_DLDistLogger::notice | ( | 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] | message | The message to log. |
void RTI_DLDistLogger::info | ( | 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] | message | The message to log. |
void RTI_DLDistLogger::debug | ( | 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] | message | The message to log. |
void RTI_DLDistLogger::trace | ( | 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] | message | The message to log. |
void RTI_DLDistLogger::log | ( | int | logLevel, |
const char * | message | ||
) |
Logs a message.
The message received is logged using the default category and the given log level.
[in] | logLevel | The level of the log message. |
[in] | message | The message to log. |
void RTI_DLDistLogger::finalizeInstance | ( | ) |
Finalizes and delete the RTI_DL_DistLogger singleton.
Unset the connections with DDS, frees memory and set singleton to NULL.
DDS_Long RTI_DLDistLogger::getFatalLogLevel | ( | ) |
Return Fatal log level.
DDS_Long RTI_DLDistLogger::getErrorLogLevel | ( | ) |
Return Error log level.
DDS_Long RTI_DLDistLogger::getWarningLogLevel | ( | ) |
Return Warning log level.
DDS_Long RTI_DLDistLogger::getNoticeLogLevel | ( | ) |
Return Notice log level.
DDS_Long RTI_DLDistLogger::getInfoLogLevel | ( | ) |
Return Info log level.
DDS_Long RTI_DLDistLogger::getDebugLogLevel | ( | ) |
Return Debug log level.