RTI Connext .Net APIs  Version 5.1.0
NDDS::ConfigLogger Class Reference

<<interface>> The singleton type used to configure RTI Connext logging. More...

#include <managed_config_dotnet.h>

Public Member Functions

LogVerbosity get_verbosity ()
 Get the verbosity at which RTI Connext is currently logging diagnostic information.
 
LogVerbosity get_verbosity_by_category (LogCategory category)
 Get the verbosity at which RTI Connext is currently logging diagnostic information in the given category.
 
void set_verbosity (LogVerbosity verbosity)
 Set the verbosity at which RTI Connext will log diagnostic information.
 
void set_verbosity_by_category (LogCategory category, LogVerbosity verbosity)
 Set the verbosity at which RTI Connext will log diagnostic information in the given category.
 
System::Boolean set_ouput_device (LoggerDevice^ outDevice)
 Register a NDDS::LoggerDevice.
 
LogPrintFormat get_print_format ()
 Get the file to which the logged output is redirected.
 
System::Boolean set_print_format (LogPrintFormat print_format)
 Set the message format that RTI Connext will use to log diagnostic information.
 

Static Public Member Functions

static ConfigLoggerget_instance ()
 Get the singleton instance of this type.
 
static void set_log_delegate (LogCallbackDelegate^ cb)
 Install a custom callback for logging.
 
static LogCallbackDelegate^ get_log_delegate ()
 Get the custom logging callback, if any has been installed.
 

Detailed Description

<<interface>> The singleton type used to configure RTI Connext logging.

Member Function Documentation

static ConfigLogger ^ NDDS::ConfigLogger::get_instance ( )
inlinestatic

Get the singleton instance of this type.

LogVerbosity NDDS::ConfigLogger::get_verbosity ( )

Get the verbosity at which RTI Connext is currently logging diagnostic information.

The default verbosity if NDDS::ConfigLogger::set_verbosity is never called is ::NDDS::LogVerbosity::NDDS_CONFIG_LOG_VERBOSITY_ERROR.

If NDDS::ConfigLogger::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.

LogVerbosity NDDS::ConfigLogger::get_verbosity_by_category ( LogCategory  category)

Get the verbosity at which RTI Connext is currently logging diagnostic information in the given category.

The default verbosity if NDDS::ConfigLogger::set_verbosity and NDDS::ConfigLogger::set_verbosity_by_category are never called is ::NDDS::LogVerbosity::NDDS_CONFIG_LOG_VERBOSITY_ERROR.

void NDDS::ConfigLogger::set_verbosity ( 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::LogVerbosity::NDDS_CONFIG_LOG_VERBOSITY_WARNING or below. (The default verbosity if you never set it is ::NDDS::LogVerbosity::NDDS_CONFIG_LOG_VERBOSITY_ERROR.)

void NDDS::ConfigLogger::set_verbosity_by_category ( LogCategory  category,
LogVerbosity  verbosity 
)

Set the verbosity at which RTI Connext will log diagnostic information in the given category.

System::Boolean NDDS::ConfigLogger::set_ouput_device ( LoggerDevice outDevice)

Register a NDDS::LoggerDevice.

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 ::NDDS::ConfigLogger::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), NDDS::LoggerDevice calls the method NDDS::LoggerDevice::close.

Parameters
device<<in>> Logging device.
LogPrintFormat NDDS::ConfigLogger::get_print_format ( )

Get the file to which the logged output is redirected.

If no output file has been registered through ::NDDS::ConfigLogger::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.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). Get the current message format that RTI Connext is using to log diagnostic information.

If NDDS::ConfigLogger::set_print_format is never called, the default format is ::NDDS::LogPrintFormat::NDDS_CONFIG_LOG_PRINT_FORMAT_DEFAULT.

System::Boolean NDDS::ConfigLogger::set_print_format ( LogPrintFormat  print_format)

Set the message format that RTI Connext will use to log diagnostic information.

If you use NDDS::ConfigLogger::set_log_delegate(), you cannot also use set_print_format(). You must use ::NDDS::LogPrintFormat::NDDS_CONFIG_LOG_PRINT_FORMAT_DEFAULT.

static void NDDS::ConfigLogger::set_log_delegate ( LogCallbackDelegate^  cb)
static

Install a custom callback for logging.

Custom log delegates are not compatible with the advanced logging information enabled by NDDS::ConfigLogger::set_print_format.

See Also
NDDS::ConfigLogger::get_log_delegate
NDDS::LogCallbackDelegate()

For example:

public class MyLogger
{
public static int MyLoggerCallback(string msg)
{
System.Console.Write("MyLoggerCallback: " + msg);
return 0;
}
}
...
NDDS.ConfigLogger.set_log_delegate(MyLogger.MyLoggerCallback);
static LogCallbackDelegate ^ NDDS::ConfigLogger::get_log_delegate ( )
static

Get the custom logging callback, if any has been installed.

See Also
NDDS::ConfigLogger::set_log_delegate
NDDS::LogCallbackDelegate()

RTI Connext .Net APIs Version 5.1.0 Copyright © Mon Feb 3 2014 Real-Time Innovations, Inc