SPP logging service. More...
Go to the source code of this file.
Macros | |
| #define | SPP_LOGE(tag, fmt, ...) |
| #define | SPP_LOGW(tag, fmt, ...) |
| #define | SPP_LOGI(tag, fmt, ...) |
| #define | SPP_LOGD(tag, fmt, ...) |
| #define | SPP_LOGV(tag, fmt, ...) |
Typedefs | |
| typedef void(*) | SPP_LogOutputFn_t(const char *p_tag, SPP_LogLevel_t level, const char *p_message) |
Enumerations | |
| enum | SPP_LogLevel_t { K_SPP_LOG_NONE = 0 , K_SPP_LOG_ERROR = 1 , K_SPP_LOG_WARN = 2 , K_SPP_LOG_INFO = 3 , K_SPP_LOG_DEBUG = 4 , K_SPP_LOG_VERBOSE = 5 } |
Functions | |
| SPP_RetVal_t | SPP_SERVICES_LOG_init (void) |
| void | SPP_SERVICES_LOG_setLevel (SPP_LogLevel_t level) |
| SPP_LogLevel_t | SPP_SERVICES_LOG_getLevel (void) |
| void | SPP_SERVICES_LOG_setOutput (SPP_LogOutputFn_t p_fn) |
| void | SPP_SERVICES_LOG_emit (const char *p_tag, SPP_LogLevel_t level, const char *p_fmt,...) |
SPP logging service.
Usage: SPP_LOGI("MY_MODULE", "sensor value = %.2f", value);
Each macro formats the message and calls the active output function. By default that function prints to stdout. SPP_CORE_boot() replaces it with one that also publishes each message as a pub/sub packet so subscribers (e.g. the SD card logger) receive log lines automatically.
To silence everything: SPP_SERVICES_LOG_setLevel(K_SPP_LOG_NONE) To change destination: SPP_SERVICES_LOG_setOutput(myFn)
Definition in file log.h.
| #define SPP_LOGE | ( | tag, | |
| fmt, | |||
| ... ) |
Definition at line 67 of file log.h.
Referenced by SPP_SERVICES_BMP390_acquireData(), SPP_SERVICES_BMP390_configCheck(), SPP_SERVICES_ICM20948_acquireData(), SPP_SERVICES_ICM20948_configDmpInit(), and SPP_SERVICES_ICM20948_init().
| #define SPP_LOGW | ( | tag, | |
| fmt, | |||
| ... ) |
Definition at line 68 of file log.h.
Referenced by SPP_SERVICES_BMP390_acquireData().
| #define SPP_LOGI | ( | tag, | |
| fmt, | |||
| ... ) |
Definition at line 69 of file log.h.
Referenced by SPP_CORE_init(), SPP_SERVICES_BMP390_acquireData(), SPP_SERVICES_BMP390_configCheck(), SPP_SERVICES_ICM20948_acquireData(), SPP_SERVICES_ICM20948_checkFifoData(), SPP_SERVICES_ICM20948_configDmpInit(), and SPP_SERVICES_ICM20948_init().
| #define SPP_LOGD | ( | tag, | |
| fmt, | |||
| ... ) |
| #define SPP_LOGV | ( | tag, | |
| fmt, | |||
| ... ) |
| typedef void(*) SPP_LogOutputFn_t(const char *p_tag, SPP_LogLevel_t level, const char *p_message) |
| enum SPP_LogLevel_t |
| SPP_RetVal_t SPP_SERVICES_LOG_init | ( | void | ) |
Definition at line 20 of file log.c.
References K_SPP_LOG_VERBOSE, K_SPP_OK, s_level, s_outFn, and SPP_SERVICES_LOG_init().
Referenced by SPP_CORE_init(), and SPP_SERVICES_LOG_init().
| void SPP_SERVICES_LOG_setLevel | ( | SPP_LogLevel_t | level | ) |
Definition at line 27 of file log.c.
References s_level, and SPP_SERVICES_LOG_setLevel().
Referenced by SPP_SERVICES_LOG_setLevel().
| SPP_LogLevel_t SPP_SERVICES_LOG_getLevel | ( | void | ) |
Definition at line 32 of file log.c.
References s_level, and SPP_SERVICES_LOG_getLevel().
Referenced by SPP_SERVICES_LOG_getLevel().
| void SPP_SERVICES_LOG_setOutput | ( | SPP_LogOutputFn_t | p_fn | ) |
Definition at line 37 of file log.c.
References s_outFn, and SPP_SERVICES_LOG_setOutput().
Referenced by SPP_SERVICES_LOG_setOutput().
| void SPP_SERVICES_LOG_emit | ( | const char * | p_tag, |
| SPP_LogLevel_t | level, | ||
| const char * | p_fmt, | ||
| ... ) |
Definition at line 42 of file log.c.
References K_LOG_BUF_SIZE, s_level, s_outFn, and SPP_SERVICES_LOG_emit().
Referenced by SPP_SERVICES_LOG_emit().