RTI Connext Micro C API Version 4.2.0
Loading...
Searching...
No Matches
osapi_log.h File Reference

OSAPI Log API. More...

#include "osapi/osapi_dll.h"
#include "osapi/osapi_heap.h"
#include "osapi/osapi_time.h"
#include "osapi/osapi_log_impl.h"

Data Structures

struct  OSAPI_LogProperty
 Configuration of logging functionality. More...
 

Macros

#define OSAPI_LOG_BASE   (0)
 Log Id base-number.
 
#define REDA_LOG_BASE   (1 << 16)
 REDA Module.
 
#define DB_LOG_BASE   (2 << 16)
 DB Module.
 
#define RT_LOG_BASE   (3 << 16)
 RT Module.
 
#define NETIO_LOG_BASE   (4 << 16)
 NETIO Module.
 
#define UDP_LOG_BASE   NETIO_LOG_BASE
 UDP Module, same as NETIO.
 
#define SHMEM_LOG_BASE   NETIO_LOG_BASE + 10000
 NETIO_SHMEM Module, same as NETIO.
 
#define SDM_LOG_BASE   NETIO_LOG_BASE + 20000
 SDM Module, same as NETIO.
 
#define CDR_LOG_BASE   (5 << 16)
 CDR Module.
 
#define XCDR_LOG_BASE   CDR_LOG_BASE + 20000
 CDR Module.
 
#define RTPS_LOG_BASE   (6 << 16)
 RTPS Module.
 
#define DDSC_LOG_BASE   (7 << 16)
 DDS_C Module.
 
#define RHSM_LOG_BASE   (8 << 16)
 RHSM Module.
 
#define WHSM_LOG_BASE   (9 << 16)
 WHSM Module.
 
#define DPSE_LOG_BASE   (10 << 16)
 DPSE Module.
 
#define DPDE_LOG_BASE   (11 << 16)
 DPDE Module.
 
#define SEC_CORE_LOG_BASE   (12 << 16)
 DDDS Security plugin.
 
#define APPGEN_LOG_BASE   (13 << 16)
 APPGEN Module.
 
#define NETIO_ZCOPY_LOG_BASE   (14 << 16)
 NETIO Zero Copy Module.
 
#define DDS_FILTER_LOG_BASE   (15 << 16)
 DDS Filter Module.
 
#define OSAPI_LOG_GET_NEXT_OBJECT_ID_EC   (OSAPI_LOG_BASE + 1)
 Retrieving the next error code failed.
 
#define OSAPI_LOG_SYSTEM_SET_PROPERTY_EC   (OSAPI_LOG_BASE + 2)
 An error occured while setting the system properties.
 
#define OSAPI_LOG_SYSTEM_TIMER_START_EC   (OSAPI_LOG_BASE + 4)
 An error occured when starting the system timer.
 
#define OSAPI_LOG_SYSTEM_TIMER_STOP_EC   (OSAPI_LOG_BASE + 5)
 An error occured when stopping the system timer.
 
#define OSAPI_LOG_THREAD_NEW_EC   (OSAPI_LOG_BASE + 6)
 An error when allocating the a thread object.
 
#define OSAPI_LOG_THREAD_CREATE_EC   (OSAPI_LOG_BASE + 7)
 An error when creating the a thread object.
 
#define OSAPI_LOG_THREAD_SEM_EC   (OSAPI_LOG_BASE + 8)
 An error when creating thread sync semaphore.
 
#define OSAPI_LOG_THREAD_EXEC_CREATE_EC   (OSAPI_LOG_BASE + 9)
 Failed to signal that a thread has been created.
 
#define OSAPI_LOG_THREAD_EXEC_START_EC   (OSAPI_LOG_BASE + 10)
 Failed to signal the start a created thread.
 
#define OSAPI_LOG_THREAD_START_EC   (OSAPI_LOG_BASE + 11)
 Failed to start a thread.
 
#define OSAPI_LOG_THREAD_DESTROY_EC   (OSAPI_LOG_BASE + 12)
 Failed to destroy a thread.
 
#define OSAPI_LOG_THREAD_DESTROY_NO_START_EC   (OSAPI_LOG_BASE + 13)
 Failed to start an unstarted thread being destroyed.
 
#define OSAPI_LOG_THREAD_DESTROY_NO_WAKEUP_EC   (OSAPI_LOG_BASE + 14)
 Failed wakeup of a thread being destroyed.
 
#define OSAPI_LOG_THREAD_INIT_EC   (OSAPI_LOG_BASE + 15)
 Failed initializing a thread.
 
#define OSAPI_LOG_THREAD_SCHEDPARAM_EC   (OSAPI_LOG_BASE + 16)
 Failed to set scheduling policy of a thread.
 
#define OSAPI_LOG_THREAD_GET_POLICY_EC   (OSAPI_LOG_BASE + 17)
 Failed to get the scheduling policy of a thread.
 
#define OSAPI_LOG_THREAD_POLICY_DIFFER_EC   (OSAPI_LOG_BASE + 18)
 Mismatch of scheduling policy of a created thread and the application thread.
 
#define OSAPI_LOG_THREAD_PRIORITY_MAP_EC   (OSAPI_LOG_BASE + 19)
 Failed to map to native thread priority values.
 
#define OSAPI_LOG_TIMER_DELETE_EC   (OSAPI_LOG_BASE + 20)
 Failed to delete the Timer object.
 
#define OSAPI_LOG_TIMER_TICK_MUTEX_EC   (OSAPI_LOG_BASE + 22)
 Failed taking or giving the Timer mutex.
 
#define OSAPI_LOG_TIMER_GET_USER_DATA_EPOCH_EC   (OSAPI_LOG_BASE + 27)
 Failed to return user data for a timeout due to mismatched epochs.
 
#define OSAPI_LOG_TIMER_NEW_EC   (OSAPI_LOG_BASE + 28)
 Failed to allocate memory for a new Timer.
 
#define OSAPI_LOG_TIMER_NEW_ENTRY_EC   (OSAPI_LOG_BASE + 29)
 Failed to allocate memory for a new Timer entry.
 
#define OSAPI_LOG_TIMER_NEW_WHEEL_EC   (OSAPI_LOG_BASE + 30)
 Failed to allocate memory for a new Timer wheel.
 
#define OSAPI_LOG_TIMER_NEW_MUTEX_EC   (OSAPI_LOG_BASE + 31)
 Failed to create a new Timer mutex.
 
#define OSAPI_LOG_TIMER_NEW_START_TIMER_EC   (OSAPI_LOG_BASE + 32)
 Failed to start a new Timer being created.
 
#define OSAPI_LOG_TIMER_DELETE_STOP_TIMER_EC   (OSAPI_LOG_BASE + 33)
 Failed to stop a Timer being deleted.
 
#define OSAPI_LOG_TIMER_DELETE_MUTEX_EC   (OSAPI_LOG_BASE + 34)
 Failed to delete the Timer mutex.
 
#define OSAPI_LOG_TIMER_MUTEX_EC   (OSAPI_LOG_BASE + 35)
 Failed to take or give a Timer mutex.
 
#define OSAPI_LOG_SEMAPHORE_DELETE_EC   (OSAPI_LOG_BASE + 36)
 Failed to delete a semaphore.
 
#define OSAPI_LOG_SEMAPHORE_NEW_EC   (OSAPI_LOG_BASE + 37)
 Failed to create a semaphore.
 
#define OSAPI_LOG_SEMAPHORE_NEW_INIT_EC   (OSAPI_LOG_BASE + 38)
 Failed to initialize a new semaphore.
 
#define OSAPI_LOG_SEMAPHORE_GIVE_EC   (OSAPI_LOG_BASE + 39)
 Failed to give a semaphore.
 
#define OSAPI_LOG_SEMAPHORE_TAKE_EC   (OSAPI_LOG_BASE + 40)
 Failed to take a semaphore.
 
#define OSAPI_LOG_MUTEX_DELETE_EC   (OSAPI_LOG_BASE + 41)
 Failed to delete a mutex.
 
#define OSAPI_LOG_MUTEX_NEW_EC   (OSAPI_LOG_BASE + 42)
 Failed to create a mutex.
 
#define OSAPI_LOG_MUTEX_TAKE_EC   (OSAPI_LOG_BASE + 43)
 Failed to take a mutex.
 
#define OSAPI_LOG_MUTEX_GIVE_EC   (OSAPI_LOG_BASE + 44)
 Failed to give a mutex.
 
#define OSAPI_LOG_MUTEX_INIT_EC   (OSAPI_LOG_BASE + 45)
 Failed to initialize a mutex.
 
#define OSAPI_LOG_HEAP_INTERNAL_ALLOCATE_EC   (OSAPI_LOG_BASE + 46)
 Failed to allocate a buffer from the heap.
 
#define OSAPI_LOG_SYSTEM_GET_TIME_EC   (OSAPI_LOG_BASE + 48)
 Failed to get current system time.
 
#define OSAPI_LOG_LAST_RECORDED_ERROR_EC   (OSAPI_LOG_BASE + 49)
 Return the last recorded error-code for the calling thread.
 
#define OSAPI_LOG_SET_THREAD_NAME_EC   (OSAPI_LOG_BASE + 50)
 Failed to set the thread name in the OS.
 
#define OSAPI_LOG_SEM_OPEN_EC   (OSAPI_LOG_BASE + 52)
 Failure during call VxWorks semOpen(...) or Posix sem_open(...) when managing shared memory segments, semaphores, or mutexes.
 
#define OSAPI_LOG_SEM_INFO_GET_EC   (OSAPI_LOG_BASE + 53)
 Failure during VxWorks call semInfoGet when managing shared memory segments, semaphores, or mutexes.
 
#define OSAPI_LOG_SD_UNMAP_EC   (OSAPI_LOG_BASE + 54)
 Failure during VxWorks call sdUnmap when managing shared memory segments, semaphores, or mutexes.
 
#define OSAPI_LOG_SD_OPEN_EC   (OSAPI_LOG_BASE + 55)
 Failure during VxWorks call sdOpen when managing shared memory segments, semaphores, or mutexes.
 
#define OSAPI_LOG_SEM_GIVE_EC   (OSAPI_LOG_BASE + 56)
 Failure during VxWorks call semGive when managing shared memory segments, semaphores, or mutexes.
 
#define OSAPI_LOG_SEM_TAKE_EC   (OSAPI_LOG_BASE + 57)
 Failure during VxWorks call semTake when managing shared memory segments, semaphores, or mutexes.
 
#define OSAPI_LOG_UNKNOWN_SEMAPHORE_TYPE_EC   (OSAPI_LOG_BASE + 58)
 Trying to perform an operation an unknown semmutex type.
 
#define OSAPI_LOG_SEGMENT_KEY_ALREADY_EXISTS_EC   (OSAPI_LOG_BASE + 59)
 Failed to create segment due to a segment already existing.
 
#define OSAPI_LOG_SEGMENT_KEY_DOESNT_EXIST_EC   (OSAPI_LOG_BASE + 60)
 Segment trying to be attached to does not exist.
 
#define OSAPI_LOG_SEGMENT_DETACH_FAILED_EC   (OSAPI_LOG_BASE + 61)
 Failed to detach from shared memory segment.
 
#define OSAPI_LOG_SHMEM_ATTACH_FAILED_EC   (OSAPI_LOG_BASE + 62)
 Attaching to shared memory segment/mutex/signaling semaphore failed.
 
#define OSAPI_LOG_SHMEM_GIVE_FAILED_EC   (OSAPI_LOG_BASE + 63)
 Failed to give shared memory mutex/signaling semaphore.
 
#define OSAPI_LOG_SHMEM_TAKE_FAILED_EC   (OSAPI_LOG_BASE + 64)
 Failed to take shared memory mutex/signaling semaphore.
 
#define OSAPI_LOG_SHMEM_SEM_DELETE_FAILED_EC   (OSAPI_LOG_BASE + 65)
 Failed to delete shared memory semaphore or mutex.
 
#define OSAPI_LOG_SHMEM_SEM_MUTEX_CREATED_EC   (OSAPI_LOG_BASE + 66)
 Error during shared memory semaphore creation/deletion.
 
#define OSAPI_LOG_SHMEM_SEGMENT_FILE_MAP_FAILED_EC   (OSAPI_LOG_BASE + 67)
 Windows specific API MapViewOfFile failed.
 
#define OSAPI_LOG_SHMEM_SET_DESCRIPTOR_EC   (OSAPI_LOG_BASE + 68)
 Windows specific error during setting security descriptor.
 
#define OSAPI_LOG_SHMEM_INIT_DESCRIPTOR_EC   (OSAPI_LOG_BASE + 69)
 Windows specific error during initialization of security descriptor.
 
#define OSAPI_LOG_SHMEM_FTRUNCATE_EC   (OSAPI_LOG_BASE + 70)
 Posix specific error during ftruncate(...) call.
 
#define OSAPI_LOG_SHMEM_MMAP_EC   (OSAPI_LOG_BASE + 71)
 Posix specific error during mmap(...) call.
 
#define OSAPI_LOG_SHMEM_SHM_OPEN_EC   (OSAPI_LOG_BASE + 72)
 Posix specific error during shm_open(...) call.
 
#define OSAPI_LOG_SHMEM_MUNMAP_EC   (OSAPI_LOG_BASE + 73)
 Posix specific error during munmap(...) call.
 
#define OSAPI_LOG_CLOSE_EC   (OSAPI_LOG_BASE + 74)
 Posix specific error during close(...) call.
 
#define OSAPI_LOG_SHMEM_UNLINK_EC   (OSAPI_LOG_BASE + 76)
 Posix specific error during unlink(...) call.
 
#define OSAPI_LOG_EXHAUSTED_POSIX_SEM_LIMIT_EC   (OSAPI_LOG_BASE + 77)
 System ran out of space to create semaphores. Consider increasing Posix sem limit.
 
#define OSAPI_LOG_SHMEM_SEM_WAIT_EC   (OSAPI_LOG_BASE + 78)
 Posix specific error during unlink(...) call.
 
#define OSAPI_LOG_SHMEM_SEM_UNLINK_EC   (OSAPI_LOG_BASE + 79)
 Posix specific error during unlink(...) call.
 
#define OSAPI_LOG_SHMEM_POSIX_GIVE_EC   (OSAPI_LOG_BASE + 80)
 Posix specific error during os specific implementation of a semaphore mutex give.
 
#define OSAPI_LOG_THREAD_SEMPOOL_EXCEEDED_EC   (OSAPI_LOG_BASE + 90)
 Failed to add a semaphore to the thread semaphore pool.
 
#define OSAPI_LOG_THREAD_SEMPOOL_INVALID_SEM_EC   (OSAPI_LOG_BASE + 91)
 Failed to delete a semaphore from the thread semaphore pool.
 
#define OSAPI_LOG_SHMEM_SIZE_EXCEEDED_EC   (OSAPI_LOG_BASE + 92)
 Trying to create a shared memory segment that is greater than (2 ^ 31) - 1. The middleware cannot support shared memory segments created than ~ 2 GB even though the operating system may.
 
#define OSAPI_LOG_MATH_OFV_EC   (OSAPI_LOG_BASE + 93)
 A math overflow occured.
 
#define OSAPI_LOG_INVALID_TIMER_RES_EC   (OSAPI_LOG_BASE + 94)
 An invalid timer resolution was specified.
 
#define OSAPI_LOG_THREAD_JOIN_EC   (OSAPI_LOG_BASE + 95)
 Failed to join a thread.
 
#define OSAPI_LOG_THREAD_GET_MAX_PRIORITY_EC   (OSAPI_LOG_BASE + 96)
 Failed to get the maximum priority value for a scheduling policy.
 
#define OSAPI_LOG_SHMEM_FSTAT_EC   (OSAPI_LOG_BASE + 97)
 POSIX specific error during fstat(...) call.
 
#define OSAPI_LOG_SHMEM_MUTEX_INIT_TIMEOUT_EC   (OSAPI_LOG_BASE + 97)
 Timed out waiting for a shared memory mutex to be initialized.
 
#define OSAPI_LOG_PTHREAD_MUTEXATTR_INIT_EC   (OSAPI_LOG_BASE + 200)
 Failed to create a pthread mutex attribute.
 
#define OSAPI_LOG_PTHREAD_MUTEXATTR_SETPSHARED_EC   (OSAPI_LOG_BASE + 201)
 Failed to set the pthread mutex attribute to be process shared.
 
#define OSAPI_LOG_PTHREAD_MUTEXATTR_SETROBUST_EC   (OSAPI_LOG_BASE + 202)
 Failed to set the pthread mutex attribute to be robust.
 
#define OSAPI_LOG_PTHREAD_MUTEXATTR_DESTROY_EC   (OSAPI_LOG_BASE + 203)
 Failed to destroy the pthread mutex attribute.
 
#define OSAPI_LOG_PTHREAD_MUTEX_INIT_EC   (OSAPI_LOG_BASE + 204)
 Failed to initialize a pthread mutex.
 
#define OSAPI_LOG_PTHREAD_MUTEX_DESTROY_EC   (OSAPI_LOG_BASE + 205)
 Failed to destroy a pthread mutex.
 
#define OSAPI_LOG_PTHREAD_MUTEX_LOCK_EC   (OSAPI_LOG_BASE + 206)
 Failed to lock a pthread mutex.
 
#define OSAPI_LOG_PTHREAD_MUTEX_UNLOCK_EC   (OSAPI_LOG_BASE + 207)
 Failed to unlock a pthread mutex.
 
#define OSAPI_LOG_PTHREAD_MUTEX_CONSISTENT_EC   (OSAPI_LOG_BASE + 208)
 Failed to set the pthread mutex to be consistent.
 
#define OSAPI_LOG_PTHREAD_CONDATTR_INIT_EC   (OSAPI_LOG_BASE + 209)
 Failed to create a pthread condition variable attribute.
 
#define OSAPI_LOG_PTHREAD_CONDATTR_SETPSHARED_EC   (OSAPI_LOG_BASE + 210)
 Failed to set the pthread condition variable attribute to be process shared.
 
#define OSAPI_LOG_PTHREAD_CONDATTR_DESTROY_EC   (OSAPI_LOG_BASE + 211)
 Failed to destroy the pthread condition variable attribute.
 
#define OSAPI_LOG_PTHREAD_COND_INIT_EC   (OSAPI_LOG_BASE + 212)
 Failed to initialize a pthread condition variable.
 
#define OSAPI_LOG_PTHREAD_COND_DESTROY_EC   (OSAPI_LOG_BASE + 213)
 Failed to destroy a pthread condition variable.
 
#define OSAPI_LOG_PTHREAD_COND_WAIT_EC   (OSAPI_LOG_BASE + 214)
 Failed to wait on a pthread condition variable.
 
#define OSAPI_LOG_PTHREAD_COND_SIGNAL_EC   (OSAPI_LOG_BASE + 215)
 Failed to signal a pthread condition variable.
 
#define OSAPI_LOG_PTHREAD_MUTEXATTR_SETTYPE_EC   (OSAPI_LOG_BASE + 216)
 Failed to set the type of a pthread mutex attribute.
 
#define OSAPI_LOG_PTHREAD_MUTEXATTR_SETPROTOCOL_EC   (OSAPI_LOG_BASE + 217)
 Failed to set the protocol of a pthread mutex attribute.
 
#define OSAPI_LOG_PTHREAD_MUTEXATTR_SETPRIOCEILING_EC   (OSAPI_LOG_BASE + 218)
 Failed to set the priority ceiling of a pthread mutex attribute.
 

Typedefs

typedef void(* OSAPI_Log_write_buffer_T) (const char *buffer, RTI_SIZE_T length)
 Optional user-defined function to output a log/trace buffer.
 
typedef void(* OSAPI_LogHandler_T) (void *param, OSAPI_LogEntry_T *entry)
 Optional user-defined function for processing new log messages.
 

Enumerations

enum  OSAPI_LogVerbosity_T { OSAPI_LOG_VERBOSITY_SILENT = 0 , OSAPI_LOG_VERBOSITY_ERROR = 1 , OSAPI_LOG_VERBOSITY_WARNING = 2 , OSAPI_LOG_VERBOSITY_DEBUG = 3 }
 Logging verbosity. More...
 

Functions

RTI_BOOL OSAPI_Log_set_log_handler (OSAPI_LogHandler_T handler, void *param)
 Install a log handler.
 
RTI_BOOL OSAPI_Log_get_log_handler (OSAPI_LogHandler_T *handler, void **param)
 Return the current log handler.
 
RTI_BOOL OSAPI_Log_set_display_handler (OSAPI_LogDisplay_T handler, void *param)
 Install a display handler.
 
RTI_BOOL OSAPI_Log_get_display_handler (OSAPI_LogDisplay_T *handler, void **param)
 Return the current display function.
 
void OSAPI_Log_set_verbosity (OSAPI_LogVerbosity_T verbosity)
 Set the log verbosity.
 
RTI_BOOL OSAPI_Log_clear (void)
 Clear the log buffer.
 
void OSAPI_Log_get_property (struct OSAPI_LogProperty *property)
 Get the current log properties.
 
RTI_BOOL OSAPI_Log_set_property (struct OSAPI_LogProperty *property)
 Set the log properties.
 
OSPSLDllExport RTI_INT32 OSAPI_Log_get_last_error_code (void)
 Returns the error code for a function that failed.
 

Detailed Description

OSAPI Log API.

Macro Definition Documentation

◆ OSAPI_LOG_BASE

#define OSAPI_LOG_BASE   (0)

Log Id base-number.

◆ REDA_LOG_BASE

#define REDA_LOG_BASE   (1 << 16)

REDA Module.

◆ DB_LOG_BASE

#define DB_LOG_BASE   (2 << 16)

DB Module.

◆ RT_LOG_BASE

#define RT_LOG_BASE   (3 << 16)

RT Module.

◆ NETIO_LOG_BASE

#define NETIO_LOG_BASE   (4 << 16)

NETIO Module.

◆ UDP_LOG_BASE

#define UDP_LOG_BASE   NETIO_LOG_BASE

UDP Module, same as NETIO.

◆ SHMEM_LOG_BASE

#define SHMEM_LOG_BASE   NETIO_LOG_BASE + 10000

NETIO_SHMEM Module, same as NETIO.

◆ SDM_LOG_BASE

#define SDM_LOG_BASE   NETIO_LOG_BASE + 20000

SDM Module, same as NETIO.

◆ CDR_LOG_BASE

#define CDR_LOG_BASE   (5 << 16)

CDR Module.

◆ XCDR_LOG_BASE

#define XCDR_LOG_BASE   CDR_LOG_BASE + 20000

CDR Module.

◆ RTPS_LOG_BASE

#define RTPS_LOG_BASE   (6 << 16)

RTPS Module.

◆ DDSC_LOG_BASE

#define DDSC_LOG_BASE   (7 << 16)

DDS_C Module.

◆ RHSM_LOG_BASE

#define RHSM_LOG_BASE   (8 << 16)

RHSM Module.

◆ WHSM_LOG_BASE

#define WHSM_LOG_BASE   (9 << 16)

WHSM Module.

◆ DPSE_LOG_BASE

#define DPSE_LOG_BASE   (10 << 16)

DPSE Module.

◆ DPDE_LOG_BASE

#define DPDE_LOG_BASE   (11 << 16)

DPDE Module.

◆ SEC_CORE_LOG_BASE

#define SEC_CORE_LOG_BASE   (12 << 16)

DDDS Security plugin.

◆ APPGEN_LOG_BASE

#define APPGEN_LOG_BASE   (13 << 16)

APPGEN Module.

◆ NETIO_ZCOPY_LOG_BASE

#define NETIO_ZCOPY_LOG_BASE   (14 << 16)

NETIO Zero Copy Module.

◆ DDS_FILTER_LOG_BASE

#define DDS_FILTER_LOG_BASE   (15 << 16)

DDS Filter Module.

◆ OSAPI_LOG_MATH_OFV_EC

#define OSAPI_LOG_MATH_OFV_EC   (OSAPI_LOG_BASE + 93)

A math overflow occured.

◆ OSAPI_LOG_INVALID_TIMER_RES_EC

#define OSAPI_LOG_INVALID_TIMER_RES_EC   (OSAPI_LOG_BASE + 94)

An invalid timer resolution was specified.