CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
Loading...
Searching...
No Matches
cdi_log_api.h
Go to the documentation of this file.
1// -------------------------------------------------------------------------------------------
2// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
3// This file is part of the AWS CDI-SDK, licensed under the BSD 2-Clause "Simplified" License.
4// License details at: https://github.com/aws/aws-cdi-sdk/blob/mainline/LICENSE
5// -------------------------------------------------------------------------------------------
6
7#ifndef CDI_LOG_API_H__
8#define CDI_LOG_API_H__
9
22#include "cdi_core_api.h"
23#include "cdi_log_enums.h"
24
25#include <stdbool.h>
26
27//*********************************************************************************************************************
28//***************************************** START OF DEFINITIONS AND TYPES ********************************************
29//*********************************************************************************************************************
30
32typedef void* CdiUserCbParameter;
36typedef void (*CdiLogMessageCallback)(const CdiLogMessageCbData* cb_data_ptr);
40typedef struct CdiLogState* CdiLogHandle;
41
55
75
110
121typedef void (*CdiLogMessageCallback)(const CdiLogMessageCbData* cb_data_ptr);
122
123//*********************************************************************************************************************
124//******************************************* START OF PUBLIC FUNCTIONS ***********************************************
125//*********************************************************************************************************************
126
138
148
158
170
181
191
198
199#endif // CDI_LOG_API_H__
200
This file declares the public API data types, structures and functions that comprise the CDI low-leve...
CdiReturnStatus
Values used for API function return codes.
Definition cdi_core_api.h:189
CDI_INTERFACE CdiLogHandle CdiLogGlobalGet(void)
Definition cdi_log_api.c:89
void(* CdiLogMessageCallback)(const CdiLogMessageCbData *cb_data_ptr)
Forward declaration to create pointer to callback function when used.
Definition cdi_log_api.h:36
CDI_INTERFACE CdiReturnStatus CdiLogComponentEnableGlobal(CdiLogComponent component, bool enable)
Definition cdi_log_api.c:56
void * CdiUserCbParameter
Forward declaration to create pointer to callback parameter when used.
Definition cdi_log_api.h:32
CDI_INTERFACE CdiReturnStatus CdiLogLevelSet(CdiConnectionHandle handle, CdiLogComponent component, CdiLogLevel level)
Definition cdi_log_api.c:70
CDI_INTERFACE CdiReturnStatus CdiLogComponentEnable(CdiConnectionHandle handle, CdiLogComponent component, bool enable)
Definition cdi_log_api.c:47
struct CdiConnectionState * CdiConnectionHandle
Forward declaration to create pointer to connection when used.
Definition cdi_log_api.h:38
struct CdiLogState * CdiLogHandle
Forward declaration to create pointer to log handle.
Definition cdi_log_api.h:40
CDI_INTERFACE CdiReturnStatus CdiLogLevelSetGlobal(CdiLogComponent component, CdiLogLevel level)
Definition cdi_log_api.c:79
CDI_INTERFACE CdiReturnStatus CdiLogStderrEnable(bool enable, CdiLogLevel level)
Definition cdi_log_api.c:84
CDI_INTERFACE bool CdiLogComponentIsEnabled(CdiConnectionHandle handle, CdiLogComponent component)
Definition cdi_log_api.c:61
This file declares the public enum data types that are part of the CDI log API.
CdiLogComponent
This selector determines the SDK component type for logging. Logging for it can be enabled/disabled u...
Definition cdi_log_enums.h:35
CdiLogMethod
This selector determines the log method to use for generating log messages within the SDK....
Definition cdi_log_enums.h:24
CdiLogLevel
This selector determines the log level of messages generated using the CdiLogMessageCallback()....
Definition cdi_log_enums.h:50
#define CDI_INTERFACE
Specify C linkage when compiling as C++ and define API interface export for Windows.
Definition cdi_utility_api.h:34
Structure definition behind the connection handles shared with the user's application program....
Definition private.h:371
This defines a structure that contains the information used to configure a callback log,...
Definition cdi_log_api.h:48
CdiLogMessageCallback log_msg_cb_ptr
Address to user defined log message callback function.
Definition cdi_log_api.h:50
CdiUserCbParameter log_user_cb_param
User defined callback parameter that is passed to the user defined log message callback function....
Definition cdi_log_api.h:53
A structure of this type is passed as the parameter to CdiLogMessageCallback(). It contains a single ...
Definition cdi_log_api.h:81
CdiLogLevel log_level
Level of the log message.
Definition cdi_log_api.h:96
int source_code_line_number
Source code line number that message was generated from.
Definition cdi_log_api.h:101
CdiUserCbParameter log_user_cb_param
If connection_handle is not NULL, this is the user defined log message callback parameter that was sp...
Definition cdi_log_api.h:90
CdiLogComponent component
Type of component that generated the message.
Definition cdi_log_api.h:93
const char * message_str
Pointer to message string. If the message contains multiple lines, each line is terminated with a '\0...
Definition cdi_log_api.h:108
const char * source_code_function_name_ptr
Pointer to string containing the name of the function the message was generated from.
Definition cdi_log_api.h:99
CdiConnectionHandle connection_handle
The handle of the connection which generated the log message. It is the instance which was created us...
Definition cdi_log_api.h:85
int line_count
For a single-line log message, contains 1. Otherwise, contains the number of lines in a multiline mes...
Definition cdi_log_api.h:105
A structure of this type is used to configure the type of log method that is being used....
Definition cdi_log_api.h:63
const char * log_filename_str
The internal state of the structure if log_method is kLogMethodFile.
Definition cdi_log_api.h:72
CdiLogMethod log_method
Indicates which structure of the union is valid.
Definition cdi_log_api.h:65
CdiLogCallbackData callback_data
The internal state of the structure contains no data if log_method is kLogMethodStdout.
Definition cdi_log_api.h:70
Structure used to hold state data for a single log of any type (stdout, callback or file).
Definition logger.c:79