RTI Distributed Logger API  Version 5.2.3
 All Classes Functions Variables
DistLogger Class Reference

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 ()
 

Detailed Description

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.

Member Function Documentation

static boolean setOptions ( Options  options)
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.

Parameters
optionsThe options to use during creation of the singleton.
Returns
true if successful, false otherwise.
static synchronized DistLogger getInstance ( )
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.

Returns
The singleton instance of this class.
void fatal ( String  message)

Log a message at the fatal level.

Parameters
messageThe log message.
void severe ( String  message)

Log a message at the severe level.

Parameters
messageThe log message.
void error ( String  message)

Log a message at the error level.

Parameters
messageThe log message.
void warning ( String  message)

Log a message at the warning level.

Parameters
messageThe log message.
void notice ( String  message)

Log a message at the notice level.

Parameters
messageThe log message.
void info ( String  message)

Log a message at the info level.

Parameters
messageThe log message.
void debug ( String  message)

Log a message at the debug level.

Parameters
messageThe log message.
void trace ( String  message)

Log a message at the trace level.

Parameters
messageThe log message.
void log ( int  level,
String  message 
)

Log a message at the specified level.

Parameters
levelThe level of the log message.
messageThe log message.
void log ( int  level,
String  message,
String  category 
)

Log a message at the specified level and with the specified category.

Parameters
levelThe level of the log message.
messageThe log message.
categoryThe category of the log message.
void log ( LogMessageData  messageData)

Log a message with the specified message data

Parameters
messageData
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).

Parameters
categoryThe category for which to set the verbosity.
verbosityThe new verbosity level for the category.
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).

Parameters
logPrintFormatThe new print format.
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 TRACE_LEVEL. See setFilterLevel() for more information on filter levels.

Returns
The current filter level.
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 IDL file provided with Distributed Logger (file: ndds.<version>/resource/rtidistlogger/idl/rtidistlog.idl). The default value is TRACE_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 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.

Parameters
filterLevelThe 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).

Filter Levels
Connext Distributed Logger
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
boolean isEnabled ( )
Returns
true if this logger is enabled, false otherwise.
int getRtpsHostId ( )
Returns
The RTPS host id. This value comes directly from the DomainParticipant associated with this instance.
int getRtpsAppId ( )
Returns
The RTPS application id. This value comes directly from the DomainParticipant associated with this instance.
static void delete ( )
static

Delete DDS entities and all resources associated with this object. It is not possible to restart this object once it has been deleted.


RTI Distributed Logger API Version 5.2.3 Copyright © Wed Apr 27 2016 Real-Time Innovations, Inc