RTI Connext DDS Micro
Version 2.4.6
|
Data Structures | |
struct | OSAPI_LogProperty |
Configuration of logging functionality. More... | |
Typedefs | |
typedef void(* | OSAPI_LogHandler_T )(void *param, OSAPI_LogEntry_T *entry) |
Optional user-defined function for processing new log messages. More... | |
Functions | |
RTI_BOOL | OSAPI_Log_set_log_handler (OSAPI_LogHandler_T handler, void *param) |
Install a log handler. More... | |
RTI_BOOL | OSAPI_Log_get_log_handler (OSAPI_LogHandler_T *handler, void **param) |
Return the current log handler. More... | |
RTI_BOOL | OSAPI_Log_set_display_handler (OSAPI_LogDisplay_T handler, void *param) |
Install a display handler. More... | |
RTI_BOOL | OSAPI_Log_get_display_handler (OSAPI_LogDisplay_T *handler, void **param) |
Return the current display function. More... | |
RTI_BOOL | OSAPI_Log_initialize (void) |
Initialize the log functionality. More... | |
RTI_BOOL | OSAPI_Log_finalize (void) |
Finalize the log buffer. More... | |
void | OSAPI_Log_set_verbosity (OSAPI_LogVerbosity_T verbosity) |
Set the log verbosity. More... | |
RTI_BOOL | OSAPI_Log_clear (void) |
Clear the log buffer. More... | |
RTI_INT32 | OSAPI_Log_get_last_error_code (void) |
Returns the error code for a function that failed. More... | |
typedef void(* OSAPI_LogHandler_T)(void *param, OSAPI_LogEntry_T *entry) |
Optional user-defined function for processing new log messages.
Definition of a function that can be installed with the logger and that will be called for each new log event.
The handler is set by OSAPI_Log_set_log_handler.
When called, provides parameters containing the raw log entry and additional optional information.
[in] | param | User-defined payload |
[in] | msg | Log entry |
[in] | kind | Kind of log message |
[in] | ec | Unique error code of log message |
[in] | module | Module of log message |
[in] | file | Name of source file. Optional. |
[in] | func | Name of function. Optional. |
[in] | line | Line number. Optional. |
[in] | argc | Variable length argument count |
[in] | ap | Variable length argument list |
RTI_BOOL OSAPI_Log_set_log_handler | ( | OSAPI_LogHandler_T | handler, |
void * | param | ||
) |
Install a log handler.
The log functionality allows the user to specify a log handler. The log handler is a function which is called for every logged event. It is up to the user to decide what to do with the log message. The handler is a global function pointer.
[in] | handler | Pointer to log handler function |
[in] | param | Parameter passed to the log handler function. This parameter is transparent to the log functionality. |
RTI_BOOL OSAPI_Log_get_log_handler | ( | OSAPI_LogHandler_T * | handler, |
void ** | param | ||
) |
Return the current log handler.
Return the current log handler.
[in] | handler | Pointer to store log handler function |
[in] | param | Pointer to store the current log handler parameter. |
RTI_BOOL OSAPI_Log_set_display_handler | ( | OSAPI_LogDisplay_T | handler, |
void * | param | ||
) |
Install a display handler.
The display handler is responsible for outputting log messages to a console.
[in] | handler | Pointer to display function |
[in] | param | Parameter passed to the display handler function. This parameter is transparent to the log functionality. |
RTI_BOOL OSAPI_Log_get_display_handler | ( | OSAPI_LogDisplay_T * | handler, |
void ** | param | ||
) |
Return the current display function.
Return the current log handler.
[in] | handler | Pointer to store display handler function |
[in] | param | Pointer to store the current display handler parameters. |
RTI_BOOL OSAPI_Log_initialize | ( | void | ) |
Initialize the log functionality.
Dynamically allocates bytes for the log ring buffer. Also prints out endianness. If store_debug_logs is false, debug-level logs are printed to the console. 0Otherwise, the logs are stored in the log buffer. The log functionality must be initialized before any log messages can be stored. It should only be called once. Since debug logs can easily exhaust the log buffer, it can optionally be enabled. However, even if debug logging is disabled, the log handler function still has the option to store it.
RTI_BOOL OSAPI_Log_finalize | ( | void | ) |
Finalize the log buffer.
This function release all memory allocated to the log buffer and release all resources associated with it.
void OSAPI_Log_set_verbosity | ( | OSAPI_LogVerbosity_T | verbosity | ) |
Set the log verbosity.
Change the log verbosity. The new setting takes immediate effect.
[in] | verbosity | New log verbosity |
RTI_BOOL OSAPI_Log_clear | ( | void | ) |
Clear the log buffer.
Clear the log buffer, all the current entries are lost
RTI_INT32 OSAPI_Log_get_last_error_code | ( | void | ) |
Returns the error code for a function that failed.
Many functions returns RTI_FALSE or NULL on failure. In order to provide additional information about reason for the failure fucntions may set an additional error code. This function returns the last error-code recorded for the calling thread.