|
Anjay Lite
|
Platform hooks for log output. More...
Go to the source code of this file.
Enumerations | |
| enum | anj_log_level_t { ANJ_LOG_LEVEL_L_TRACE , ANJ_LOG_LEVEL_L_DEBUG , ANJ_LOG_LEVEL_L_INFO , ANJ_LOG_LEVEL_L_WARNING , ANJ_LOG_LEVEL_L_ERROR , ANJ_LOG_LEVEL_L_MUTED } |
Functions | |
| void | anj_log_handler_impl_full (anj_log_level_t level, const char *module, const char *file, int line, const char *format,...) |
| void | anj_log_handler_output (const char *output, size_t len) |
Platform hooks for log output.
This header declares the minimal API that platform integrators may implement or override to control how Anjay Lite logs are processed:
The implementation may route logs to console, syslog, RTT, UART, or any other platform-specific output. Which functions are active depends on compile-time configuration (e.g. ANJ_LOG_FULL or ANJ_LOG_HANDLER_OUTPUT_ALT).
| enum anj_log_level_t |
Specifies level of a log statement.
ANJ_LOG_LEVEL_ prefix.L_level instead of just level to avoid collisions with applications that define e.g. DEBUG. | Enumerator | |
|---|---|
| ANJ_LOG_LEVEL_L_TRACE | |
| ANJ_LOG_LEVEL_L_DEBUG | |
| ANJ_LOG_LEVEL_L_INFO | |
| ANJ_LOG_LEVEL_L_WARNING | |
| ANJ_LOG_LEVEL_L_ERROR | |
| ANJ_LOG_LEVEL_L_MUTED | |
| void anj_log_handler_impl_full | ( | anj_log_level_t | level, |
| const char * | module, | ||
| const char * | file, | ||
| int | line, | ||
| const char * | format, | ||
| ... | |||
| ) |
Full implementation of log handler, enabled if ANJ_LOG_FULL is defined.
| level | Log level of the message. |
| module | Name of the module originating the log message. |
| file | Name of the source file where the log message originates from. |
| line | Line number in the source file where the log message originates from. |
| format | printf-style format string for the log message. |
| ... | Arguments for the format string. |
| void anj_log_handler_output | ( | const char * | output, |
| size_t | len | ||
| ) |
Function used to output the formatted log strings, if one of builtin handler implementations is enabled.
| output | Formatted log statement to output. |
| len | Length of formatted log statement, effectively equal to strlen(output) |