CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
|
This file declares the public API data types, structures and functions that comprise the CDI log API. More...
Go to the source code of this file.
Data Structures | |
struct | CdiLogCallbackData |
This defines a structure that contains the information used to configure a callback log, referred to using the enumerated value kLogMethodCallback. More... | |
struct | CdiLogMethodData |
A structure of this type is used to configure the type of log method that is being used. It is passed as the parameter to CdiCoreInitialize() and as part of the CdiTxConfigData or CdiRxConfigData configuration data passed to the Cdi...TxCreate() API functions. More... | |
struct | CdiLogMessageCbData |
A structure of this type is passed as the parameter to CdiLogMessageCallback(). It contains a single log message generated by the SDK. More... | |
Typedefs | |
typedef void * | CdiUserCbParameter |
Forward declaration to create pointer to callback parameter when used. | |
typedef struct CdiLogMessageCbData | CdiLogMessageCbData |
Forward declaration to create pointer to log message callback data when used. | |
typedef void(* | CdiLogMessageCallback) (const CdiLogMessageCbData *cb_data_ptr) |
Forward declaration to create pointer to callback function when used. | |
typedef struct CdiConnectionState * | CdiConnectionHandle |
Forward declaration to create pointer to connection when used. | |
typedef struct CdiLogState * | CdiLogHandle |
Forward declaration to create pointer to log handle. | |
typedef struct CdiLogCallbackData | CdiLogCallbackData |
Forward declaration to create pointer to callback data when used. | |
typedef struct CdiLogMethodData | CdiLogMethodData |
Forward declaration to create pointer to method data when used. | |
Functions | |
CDI_INTERFACE CdiReturnStatus | CdiLogComponentEnable (CdiConnectionHandle handle, CdiLogComponent component, bool enable) |
CDI_INTERFACE CdiReturnStatus | CdiLogComponentEnableGlobal (CdiLogComponent component, bool enable) |
CDI_INTERFACE bool | CdiLogComponentIsEnabled (CdiConnectionHandle handle, CdiLogComponent component) |
CDI_INTERFACE CdiReturnStatus | CdiLogLevelSet (CdiConnectionHandle handle, CdiLogComponent component, CdiLogLevel level) |
CDI_INTERFACE CdiReturnStatus | CdiLogLevelSetGlobal (CdiLogComponent component, CdiLogLevel level) |
CDI_INTERFACE CdiReturnStatus | CdiLogStderrEnable (bool enable, CdiLogLevel level) |
CDI_INTERFACE CdiLogHandle | CdiLogGlobalGet (void) |
This file declares the public API data types, structures and functions that comprise the CDI log API.
typedef void(* CdiLogMessageCallback)(const CdiLogMessageCbData *cb_data_ptr) |
Forward declaration to create pointer to callback function when used.
Prototype of log message callback function. The user code can optionally implement a function with this prototype, and provide it as part of the CdiTxConfigData or CdiRxConfigData that is passed to one of the Cdi...Create() functions.
This callback function is invoked whenever a log message is generated. Control of which log components are enabled is set using CdiLogComponentEnable(). Log levels are set using CdiLogLevelSet().
cb_data_ptr | A pointer to an CdiLogMessageCbData structure. |
CDI_INTERFACE CdiReturnStatus CdiLogComponentEnable | ( | CdiConnectionHandle | handle, |
CdiLogComponent | component, | ||
bool | enable ) |
Enable or disable specific log component messages for a specific connection or the global logger. All components are disabled by default.
handle | Connection handle returned by Cdi...TxCreate() API functions. If NULL, then the global logger is used. |
component | Type of component to enable/disable log message generation. |
enable | True to enable, False to disable. |
CDI_INTERFACE CdiReturnStatus CdiLogComponentEnableGlobal | ( | CdiLogComponent | component, |
bool | enable ) |
Enable or disable specific log component messages globally for all logs. All components are disabled by default.
component | Type of component to enable/disable log message generation. |
enable | To enable use true, otherwise use false. |
CDI_INTERFACE bool CdiLogComponentIsEnabled | ( | CdiConnectionHandle | handle, |
CdiLogComponent | component ) |
Determine if a component is enabled for logging for a specific connection or the global logger.
handle | Connection handle returned by Cdi...TxCreate() API functions. If NULL, then the global logger is used. |
component | Type of component to check. |
CDI_INTERFACE CdiLogHandle CdiLogGlobalGet | ( | void | ) |
Get the handle to the global log set by the CdiCoreInitialize() API.
CDI_INTERFACE CdiReturnStatus CdiLogLevelSet | ( | CdiConnectionHandle | handle, |
CdiLogComponent | component, | ||
CdiLogLevel | level ) |
Set log level for a component for a specific connection or the global logger. Log messages of the specified level or lower are generated. The default log level is set to kLogInfo.
handle | Connection handle returned by Cdi...TxCreate() API functions. If NULL, then the global logger is used. |
component | Type of component to set log level. |
level | Log level to set. |
CDI_INTERFACE CdiReturnStatus CdiLogLevelSetGlobal | ( | CdiLogComponent | component, |
CdiLogLevel | level ) |
Set log level for a component for all logs. Log messages of the specified level or lower are generated. The default log level is set to kLogInfo.
component | Type of component to set log level. |
level | Log level to set. |
CDI_INTERFACE CdiReturnStatus CdiLogStderrEnable | ( | bool | enable, |
CdiLogLevel | level ) |
Send log messages to stderr in addition to log files, if log files are enabled.
enable | Use true to enable, false to disable. |
level | Log level to enable output to stderr. |