acc_integration_log.h File Reference

Go to the source code of this file.

Macros

#define ACC_LOG(level, ...)   acc_integration_log(level, MODULE, __VA_ARGS__)
 
#define ACC_LOG_ERROR(...)   ACC_LOG(ACC_LOG_LEVEL_ERROR, __VA_ARGS__)
 
#define ACC_LOG_WARNING(...)   ACC_LOG(ACC_LOG_LEVEL_WARNING, __VA_ARGS__)
 
#define ACC_LOG_INFO(...)   ACC_LOG(ACC_LOG_LEVEL_INFO, __VA_ARGS__)
 
#define ACC_LOG_VERBOSE(...)   ACC_LOG(ACC_LOG_LEVEL_VERBOSE, __VA_ARGS__)
 
#define ACC_LOG_DEBUG(...)   ACC_LOG(ACC_LOG_LEVEL_DEBUG, __VA_ARGS__)
 
#define ACC_LOG_SIGN(a)   (((a) < 0.0f) ? (-1.0f) : (1.0f))
 
#define ACC_LOG_FLOAT_INT(a)   ((unsigned long int)((a) + 0.0000005f))
 
#define ACC_LOG_FLOAT_DEC(a)   (unsigned long int)((1000000.0f * (((a) + 0.0000005f) - ((unsigned int)((a) + 0.0000005f)))))
 
#define ACC_LOG_FLOAT_TO_INTEGER(a)   (((a) < 0.0f) ? "-" : ""), ACC_LOG_FLOAT_INT((a) * ACC_LOG_SIGN(a)), ACC_LOG_FLOAT_DEC((a) * ACC_LOG_SIGN(a))
 
#define PRIfloat   "s%lu.%06lu"
 Specifier for printing float type using integers. More...
 
#define PRINTF_ATTRIBUTE_CHECK(a, b)
 

Functions

void acc_integration_log (acc_log_level_t level, const char *module, const char *format,...)
 Log function. More...
 

Macro Definition Documentation

◆ ACC_LOG

#define ACC_LOG (   level,
  ... 
)    acc_integration_log(level, MODULE, __VA_ARGS__)

Definition at line 14 of file acc_integration_log.h.

◆ ACC_LOG_DEBUG

#define ACC_LOG_DEBUG (   ...)    ACC_LOG(ACC_LOG_LEVEL_DEBUG, __VA_ARGS__)

Definition at line 20 of file acc_integration_log.h.

◆ ACC_LOG_ERROR

#define ACC_LOG_ERROR (   ...)    ACC_LOG(ACC_LOG_LEVEL_ERROR, __VA_ARGS__)

Definition at line 16 of file acc_integration_log.h.

◆ ACC_LOG_FLOAT_DEC

#define ACC_LOG_FLOAT_DEC (   a)    (unsigned long int)((1000000.0f * (((a) + 0.0000005f) - ((unsigned int)((a) + 0.0000005f)))))

Definition at line 24 of file acc_integration_log.h.

◆ ACC_LOG_FLOAT_INT

#define ACC_LOG_FLOAT_INT (   a)    ((unsigned long int)((a) + 0.0000005f))

Definition at line 23 of file acc_integration_log.h.

◆ ACC_LOG_FLOAT_TO_INTEGER

◆ ACC_LOG_INFO

#define ACC_LOG_INFO (   ...)    ACC_LOG(ACC_LOG_LEVEL_INFO, __VA_ARGS__)

Definition at line 18 of file acc_integration_log.h.

◆ ACC_LOG_SIGN

#define ACC_LOG_SIGN (   a)    (((a) < 0.0f) ? (-1.0f) : (1.0f))

Definition at line 22 of file acc_integration_log.h.

◆ ACC_LOG_VERBOSE

#define ACC_LOG_VERBOSE (   ...)    ACC_LOG(ACC_LOG_LEVEL_VERBOSE, __VA_ARGS__)

Definition at line 19 of file acc_integration_log.h.

◆ ACC_LOG_WARNING

#define ACC_LOG_WARNING (   ...)    ACC_LOG(ACC_LOG_LEVEL_WARNING, __VA_ARGS__)

Definition at line 17 of file acc_integration_log.h.

◆ PRIfloat

◆ PRINTF_ATTRIBUTE_CHECK

#define PRINTF_ATTRIBUTE_CHECK (   a,
 
)

Definition at line 37 of file acc_integration_log.h.

Function Documentation

◆ acc_integration_log()

void acc_integration_log ( acc_log_level_t  level,
const char *  module,
const char *  format,
  ... 
)

Log function.

This log function can be used as a complement to for example printf. It adds useful information to the log such as time and log level

Parameters
[in]levelThe severity level for the log
[in]moduleThe name of the SW module from where the log is called
[in]formatThe information to be logged, same format as for printf

Definition at line 21 of file acc_integration_log.c.