|
hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
|
Generic logging API. More...
Go to the source code of this file.
Data Structures | |
| struct | ifx_logger_t |
| Generic Logger object used to decapsulate concrete implementation from interface. More... | |
Macros | |
| #define | LIB_LOGGER UINT8_C(0x0C) |
| Logger library identifier ID. | |
| #define | IFX_LOGGER_INITIALIZE UINT8_C(0x01) |
| Reusable IFX error encoding function identifier for any function initializing a Logger. | |
| #define | IFX_LOGGER_LOG UINT8_C(0x02) |
| Reusable IFX error encoding function identifier for all functions logging data. | |
| #define | IFX_LOGGER_SET_LEVEL UINT8_C(0x03) |
| IFX error encoding function identifier for ifx_logger_set_level(). | |
| #define | IFX_LOGGER_FORMAT_ERROR 0x01u |
| IFX error encoding error reason if error occurred formatting string in ifx_logger_log(). | |
Typedefs | |
| typedef ifx_status_t(* | ifx_logger_log_callback_t) (const ifx_logger_t *self, const char *source, ifx_log_level level, const char *message) |
| Implementation specific log function. | |
| typedef ifx_status_t(* | ifx_logger_set_level_callback_t) (ifx_logger_t *self, ifx_log_level level) |
| Implementation specific log level setter. | |
| typedef void(* | ifx_logger_destroy_callback_t) (ifx_logger_t *self) |
| Implementation specific destructor. | |
Enumerations | |
| enum | ifx_log_level { IFX_LOG_DEBUG = 0 , IFX_LOG_INFO = 1 , IFX_LOG_WARN = 2 , IFX_LOG_ERROR = 3 , IFX_LOG_FATAL = 4 } |
| Log level for filtering messages to actually be logged. More... | |
Variables | |
| ifx_logger_t * | ifx_logger_default |
| Default Logger instance to be used. | |
Generic logging API.
Definition in file ifx-logger.h.
| #define IFX_LOGGER_FORMAT_ERROR 0x01u |
IFX error encoding error reason if error occurred formatting string in ifx_logger_log().
Must be used in combination with IFX_LOGGER_LOG.
Definition at line 49 of file ifx-logger.h.
| #define IFX_LOGGER_INITIALIZE UINT8_C(0x01) |
Reusable IFX error encoding function identifier for any function initializing a Logger.
Definition at line 30 of file ifx-logger.h.
| #define IFX_LOGGER_LOG UINT8_C(0x02) |
Reusable IFX error encoding function identifier for all functions logging data.
Definition at line 36 of file ifx-logger.h.
| #define IFX_LOGGER_SET_LEVEL UINT8_C(0x03) |
IFX error encoding function identifier for ifx_logger_set_level().
Definition at line 41 of file ifx-logger.h.
| #define LIB_LOGGER UINT8_C(0x0C) |
Logger library identifier ID.
Definition at line 24 of file ifx-logger.h.
| typedef void(* ifx_logger_destroy_callback_t) (ifx_logger_t *self) |
Implementation specific destructor.
Different loggers may need different clean-up functionality. This function type gives a generic interface for performing clean-up.
| [in] | self | Logger object being destroyed. |
Definition at line 222 of file ifx-logger.h.
| typedef ifx_status_t(* ifx_logger_log_callback_t) (const ifx_logger_t *self, const char *source, ifx_log_level level, const char *message) |
Implementation specific log function.
Used by ifx_logger_log() to call concrete implementation.
| [in] | self | Logger object the function was called for. |
| [in] | source | String with information where the log originated from. |
| [in] | level | ifx_log_level of message (used for filtering). |
| [in] | message | Formatted string to be logged. |
IFX_SUCCESS if successful, any other value in case of error. Definition at line 168 of file ifx-logger.h.
| typedef ifx_status_t(* ifx_logger_set_level_callback_t) (ifx_logger_t *self, ifx_log_level level) |
Implementation specific log level setter.
Used by ifx_logger_set_level() to call concrete implementation. Depending on the logging mechanism used this might wrap to an external library function, etc.
| [in] | self | Logger object to set log level for. |
| [in] | level | Minimum log level of interest. |
IFX_SUCCESS if successful, any other value in case of error. Definition at line 197 of file ifx-logger.h.
| enum ifx_log_level |
Log level for filtering messages to actually be logged.
Definition at line 57 of file ifx-logger.h.
|
extern |
Default Logger instance to be used.
Set via ifx_logger_set_default(), do NOT edit manually.