caffeine-sal 0.1.17
Header-only polymorphic middleware services layer for the Caffeine Framework
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
cfn_sal_utl_logging.h File Reference

Abstract Logging service interface. More...

#include <stdarg.h>
#include "cfn_sal.h"

Go to the source code of this file.

Data Structures

struct  cfn_sal_utl_logging_config_t
 
struct  cfn_sal_utl_logging_api_s
 Logging Virtual Method Table (VMT). More...
 

Macros

#define CFN_SAL_UTL_TYPE_LOGGING   CFN_SAL_TYPE('L', 'O', 'G')
 

Typedefs

typedef struct cfn_sal_utl_logging_s cfn_sal_utl_logging_t
 
typedef struct cfn_sal_utl_logging_api_s cfn_sal_utl_logging_api_t
 
typedef void(* cfn_sal_utl_logging_callback_t) (cfn_sal_utl_logging_t *driver, uint32_t event, uint32_t error, void *user_arg)
 

Enumerations

enum  cfn_sal_utl_logging_level_t {
  CFN_SAL_UTL_LOGGING_LEVEL_DEBUG = 0 , CFN_SAL_UTL_LOGGING_LEVEL_INFO , CFN_SAL_UTL_LOGGING_LEVEL_WARN , CFN_SAL_UTL_LOGGING_LEVEL_ERROR ,
  CFN_SAL_UTL_LOGGING_LEVEL_FATAL
}
 
enum  cfn_sal_utl_logging_target_t { CFN_SAL_UTL_LOGGING_TARGET_CONSOLE = 0 , CFN_SAL_UTL_LOGGING_TARGET_FILE , CFN_SAL_UTL_LOGGING_TARGET_NETWORK }
 
enum  cfn_sal_utl_logging_format_t { CFN_SAL_UTL_LOGGING_FORMAT_TEXT = 0 , CFN_SAL_UTL_LOGGING_FORMAT_JSON }
 

Functions

 CFN_HAL_VMT_CHECK (struct cfn_sal_utl_logging_api_s)
 
 CFN_SAL_CREATE_DRIVER_TYPE (sal_utl_logging, cfn_sal_utl_logging_config_t, cfn_sal_utl_logging_api_t, cfn_sal_phy_t, cfn_sal_utl_logging_callback_t)
 
CFN_HAL_INLINE void cfn_sal_utl_logging_populate (cfn_sal_utl_logging_t *driver, uint32_t peripheral_id, void *dependency, const cfn_sal_utl_logging_api_t *api, const cfn_sal_phy_t *phy, const cfn_sal_utl_logging_config_t *config, cfn_sal_utl_logging_callback_t callback, void *user_arg)
 
cfn_hal_error_code_t cfn_sal_utl_logging_construct (cfn_sal_utl_logging_t *driver, const cfn_sal_utl_logging_config_t *config, const cfn_sal_phy_t *phy, void *dependency, cfn_sal_utl_logging_callback_t callback, void *user_arg)
 
cfn_hal_error_code_t cfn_sal_utl_logging_destruct (cfn_sal_utl_logging_t *driver)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_init (cfn_sal_utl_logging_t *driver)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_deinit (cfn_sal_utl_logging_t *driver)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_config_set (cfn_sal_utl_logging_t *driver, const cfn_sal_utl_logging_config_t *config)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_config_get (cfn_sal_utl_logging_t *driver, cfn_sal_utl_logging_config_t *config)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_callback_register (cfn_sal_utl_logging_t *driver, cfn_sal_utl_logging_callback_t callback, void *user_arg)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_power_state_set (cfn_sal_utl_logging_t *driver, cfn_hal_power_state_t state)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_event_enable (cfn_sal_utl_logging_t *driver, uint32_t event_mask)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_event_disable (cfn_sal_utl_logging_t *driver, uint32_t event_mask)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_event_get (cfn_sal_utl_logging_t *driver, uint32_t *event_mask)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_error_enable (cfn_sal_utl_logging_t *driver, uint32_t error_mask)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_error_disable (cfn_sal_utl_logging_t *driver, uint32_t error_mask)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_error_get (cfn_sal_utl_logging_t *driver, uint32_t *error_mask)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_log (cfn_sal_utl_logging_t *driver, cfn_sal_utl_logging_level_t level, const char *fmt,...)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_flush (cfn_sal_utl_logging_t *driver)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_set_level (cfn_sal_utl_logging_t *driver, cfn_sal_utl_logging_level_t level)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_set_output_target (cfn_sal_utl_logging_t *driver, cfn_sal_utl_logging_target_t target)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_enable_color (cfn_sal_utl_logging_t *driver, bool enable)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_set_format (cfn_sal_utl_logging_t *driver, cfn_sal_utl_logging_format_t format)
 

Detailed Description

Abstract Logging service interface.

Macro Definition Documentation

◆ CFN_SAL_UTL_TYPE_LOGGING

#define CFN_SAL_UTL_TYPE_LOGGING   CFN_SAL_TYPE('L', 'O', 'G')

Typedef Documentation

◆ cfn_sal_utl_logging_api_t

◆ cfn_sal_utl_logging_callback_t

typedef void(* cfn_sal_utl_logging_callback_t) (cfn_sal_utl_logging_t *driver, uint32_t event, uint32_t error, void *user_arg)

◆ cfn_sal_utl_logging_t

typedef struct cfn_sal_utl_logging_s cfn_sal_utl_logging_t

Enumeration Type Documentation

◆ cfn_sal_utl_logging_format_t

Enumerator
CFN_SAL_UTL_LOGGING_FORMAT_TEXT 
CFN_SAL_UTL_LOGGING_FORMAT_JSON 

◆ cfn_sal_utl_logging_level_t

Enumerator
CFN_SAL_UTL_LOGGING_LEVEL_DEBUG 
CFN_SAL_UTL_LOGGING_LEVEL_INFO 
CFN_SAL_UTL_LOGGING_LEVEL_WARN 
CFN_SAL_UTL_LOGGING_LEVEL_ERROR 
CFN_SAL_UTL_LOGGING_LEVEL_FATAL 

◆ cfn_sal_utl_logging_target_t

Enumerator
CFN_SAL_UTL_LOGGING_TARGET_CONSOLE 
CFN_SAL_UTL_LOGGING_TARGET_FILE 
CFN_SAL_UTL_LOGGING_TARGET_NETWORK 

Function Documentation

◆ CFN_HAL_VMT_CHECK()

CFN_HAL_VMT_CHECK ( struct cfn_sal_utl_logging_api_s  )

◆ CFN_SAL_CREATE_DRIVER_TYPE()

CFN_SAL_CREATE_DRIVER_TYPE ( sal_utl_logging  ,
cfn_sal_utl_logging_config_t  ,
cfn_sal_utl_logging_api_t  ,
cfn_sal_phy_t  ,
cfn_sal_utl_logging_callback_t   
)

◆ cfn_sal_utl_logging_callback_register()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_callback_register ( cfn_sal_utl_logging_t driver,
cfn_sal_utl_logging_callback_t  callback,
void *  user_arg 
)

◆ cfn_sal_utl_logging_config_get()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_config_get ( cfn_sal_utl_logging_t driver,
cfn_sal_utl_logging_config_t config 
)

◆ cfn_sal_utl_logging_config_set()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_config_set ( cfn_sal_utl_logging_t driver,
const cfn_sal_utl_logging_config_t config 
)

◆ cfn_sal_utl_logging_construct()

cfn_hal_error_code_t cfn_sal_utl_logging_construct ( cfn_sal_utl_logging_t driver,
const cfn_sal_utl_logging_config_t config,
const cfn_sal_phy_t phy,
void *  dependency,
cfn_sal_utl_logging_callback_t  callback,
void *  user_arg 
)

◆ cfn_sal_utl_logging_deinit()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_deinit ( cfn_sal_utl_logging_t driver)

◆ cfn_sal_utl_logging_destruct()

cfn_hal_error_code_t cfn_sal_utl_logging_destruct ( cfn_sal_utl_logging_t driver)

◆ cfn_sal_utl_logging_enable_color()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_enable_color ( cfn_sal_utl_logging_t driver,
bool  enable 
)

◆ cfn_sal_utl_logging_error_disable()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_error_disable ( cfn_sal_utl_logging_t driver,
uint32_t  error_mask 
)

◆ cfn_sal_utl_logging_error_enable()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_error_enable ( cfn_sal_utl_logging_t driver,
uint32_t  error_mask 
)

◆ cfn_sal_utl_logging_error_get()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_error_get ( cfn_sal_utl_logging_t driver,
uint32_t *  error_mask 
)

◆ cfn_sal_utl_logging_event_disable()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_event_disable ( cfn_sal_utl_logging_t driver,
uint32_t  event_mask 
)

◆ cfn_sal_utl_logging_event_enable()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_event_enable ( cfn_sal_utl_logging_t driver,
uint32_t  event_mask 
)

◆ cfn_sal_utl_logging_event_get()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_event_get ( cfn_sal_utl_logging_t driver,
uint32_t *  event_mask 
)

◆ cfn_sal_utl_logging_flush()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_flush ( cfn_sal_utl_logging_t driver)

◆ cfn_sal_utl_logging_init()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_init ( cfn_sal_utl_logging_t driver)

◆ cfn_sal_utl_logging_log()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_log ( cfn_sal_utl_logging_t driver,
cfn_sal_utl_logging_level_t  level,
const char *  fmt,
  ... 
)

◆ cfn_sal_utl_logging_populate()

CFN_HAL_INLINE void cfn_sal_utl_logging_populate ( cfn_sal_utl_logging_t driver,
uint32_t  peripheral_id,
void *  dependency,
const cfn_sal_utl_logging_api_t api,
const cfn_sal_phy_t phy,
const cfn_sal_utl_logging_config_t config,
cfn_sal_utl_logging_callback_t  callback,
void *  user_arg 
)

◆ cfn_sal_utl_logging_power_state_set()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_power_state_set ( cfn_sal_utl_logging_t driver,
cfn_hal_power_state_t  state 
)

◆ cfn_sal_utl_logging_set_format()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_set_format ( cfn_sal_utl_logging_t driver,
cfn_sal_utl_logging_format_t  format 
)

◆ cfn_sal_utl_logging_set_level()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_set_level ( cfn_sal_utl_logging_t driver,
cfn_sal_utl_logging_level_t  level 
)

◆ cfn_sal_utl_logging_set_output_target()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_logging_set_output_target ( cfn_sal_utl_logging_t driver,
cfn_sal_utl_logging_target_t  target 
)