RTI Distributed Logger API
Version 6.1.0
|
Public Member Functions | |
void | fatal (String message) |
void | severe (String message) |
void | error (String message) |
void | warning (String message) |
void | notice (String message) |
void | info (String message) |
void | debug (String message) |
void | trace (String message) |
void | log (int level, String message) |
void | log (int level, String message, String category) |
void | log (LogMessageData messageData) |
void | setRTILoggerVerbosityByCategory (LogCategory category, LogVerbosity verbosity) |
void | setRTILoggerPrintFormat (LogPrintFormat logPrintFormat) |
int | getFilterLevel () |
void | setFilterLevel (int filterLevel) |
boolean | isEnabled () |
int | getRtpsHostId () |
int | getRtpsAppId () |
Static Public Member Functions | |
static boolean | setOptions (Options options) |
static synchronized DistLogger | getInstance () |
static void | delete () |
This class provides an API to publish log messages to a DDS Topic. Generally, this class is used by an application logging infrastructure to integrate it into an application although the API can certainly be used directly as well.
|
static |
Sets the options used during creation of the Distributed Logger singleton. It is important to note that this method is only successful if the Distributed Logger singleton does not exist.
options | The options to use during creation of the singleton. |
References Options.getApplicationKind(), Options.getFilterLevel(), Options.getLogInfrastructureMessages(), Options.getQueueSize(), Options.getThreadPriority(), Options.isRemoteAdministrationEnabled(), and DistLogger.setFilterLevel().
|
static |
This method provides access to the singleton instance of this class. If the instance does not exist it will be created. Note that no change in options is allowed after the singleton is created.
void fatal | ( | String | message | ) |
void severe | ( | String | message | ) |
void error | ( | String | message | ) |
Log a message at the error level.
message | The log message. |
References DistLogger.log().
Referenced by DistLogger.delete(), and DistLogger.log().
void warning | ( | String | message | ) |
void notice | ( | String | message | ) |
void info | ( | String | message | ) |
void debug | ( | String | message | ) |
void trace | ( | String | message | ) |
void log | ( | int | level, |
String | message | ||
) |
Log a message at the specified level.
level | The level of the log message. |
message | The log message. |
Referenced by DistLogger.debug(), DistLogger.error(), DistLogger.fatal(), DistLogger.info(), DistLogger.log(), DistLogger.notice(), DistLogger.severe(), DistLogger.trace(), and DistLogger.warning().
void log | ( | int | level, |
String | message, | ||
String | category | ||
) |
Log a message at the specified level and with the specified category.
level | The level of the log message. |
message | The log message. |
category | The category of the log message. |
References DistLogger.log().
void log | ( | LogMessageData | messageData | ) |
Log a message with the specified message data
messageData |
References DistLogger.error(), Options.isEchoToStdout(), DistLogger.isEnabled(), LogMessageData.level, LogMessageData.message, DistLogger.setFilterLevel(), DistLogger.setRTILoggerPrintFormat(), and DistLogger.setRTILoggerVerbosityByCategory().
void setRTILoggerVerbosityByCategory | ( | LogCategory | category, |
LogVerbosity | verbosity | ||
) |
This method is mostly a pass-through to the appropriate call in the RTI DDS library but it also has the benefit of keeping the state of the logger in synch with this setting in the library (there is no other way to do so).
category | The category for which to set the verbosity. |
verbosity | The new verbosity level for the category. |
References DistLogger.isEnabled().
Referenced by DistLogger.log().
void setRTILoggerPrintFormat | ( | LogPrintFormat | logPrintFormat | ) |
This method is mostly a pass-through to the appropriate call in the RTI DDS library but it also has the benefit of keeping the state of the logger in synch with this setting in the library (there is no other way to do so).
logPrintFormat | The new print format. |
References DistLogger.isEnabled().
Referenced by DistLogger.log().
int getFilterLevel | ( | ) |
Gets the filter level.
Supported Filter Levels: See the IDL file provided with Distributed Logger (ndds.<version>/resource/rtidistlogger/idl/rtidistlog.idl)
The default value is INFO_LEVEL. See setFilterLevel() for more information on filter levels.
void setFilterLevel | ( | int | filterLevel | ) |
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 INFO_LEVEL. Or see the IDL file provided with Distributed Logger (file: ndds.<version>/resource/rtidistlogger/idl/rtidistlog.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 Java, use com.rti.dl.INFO_LEVEL.VALUE.
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.
filterLevel | The new log level. |
The following table shows how Connext log levels map to Distributed Logger log filter levels. Not all Distributed Logger levels appear in this table because there is not a one-to-one mapping between Connext and Distributed Logger levels (there are more levels in Distributed Logger).
Connext DDS API constant | Distributed Logger IDL constant |
---|---|
NDDS_CONFIG_LOG_FATAL_ERROR | FATAL_LEVEL |
NDDS_CONFIG_LOG_LEVEL_ERROR | ERROR_LEVEL |
NDDS_CONFIG_LOG_LEVEL_WARNING | WARNING_LEVEL |
NDDS_CONFIG_LOG_LEVEL_STATUS_LOCAL | NOTICE_LEVEL |
NDDS_CONFIG_LOG_LEVEL_STATUS_REMOTE | INFO_LEVEL |
NDDS_CONFIG_LOG_LEVEL_DEBUG | DEBUG_LEVEL |
Referenced by DistLogger.log(), and DistLogger.setOptions().
boolean isEnabled | ( | ) |
Referenced by DistLogger.log(), DistLogger.setRTILoggerPrintFormat(), and DistLogger.setRTILoggerVerbosityByCategory().
int getRtpsHostId | ( | ) |
DomainParticipant
associated with this instance. int getRtpsAppId | ( | ) |
DomainParticipant
associated with this instance.
|
static |
Delete DDS entities and all resources associated with this object. It is not possible to restart this object once it has been deleted.
References DistLogger.error(), and Options.getLogInfrastructureMessages().