doc: subsys: logging: Add documentation for new logger

Documentation for new logger subsystem.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2018-06-29 14:20:45 +02:00 committed by Anas Nashif
commit 5ea5b8d35f
9 changed files with 496 additions and 4 deletions

View file

@ -14,6 +14,14 @@
extern "C" {
#endif
/**
* @brief Logger API
* @defgroup log_api Logging API
* @ingroup logger
* @{
*/
#define LOG_LEVEL_NONE 0
#define LOG_LEVEL_ERR 1
#define LOG_LEVEL_WRN 2
@ -275,6 +283,11 @@ int log_printk(const char *fmt, va_list ap);
#define LOG_MODULE_REGISTER() /* Empty */
#endif
/**
* @}
*/
#ifdef __cplusplus
}
#endif

View file

@ -12,6 +12,13 @@
extern "C" {
#endif
/**
* @brief Logger backend interface
* @defgroup log_backend Logger backend interface
* @ingroup logger
* @{
*/
/* Forward declaration of the log_backend type. */
struct log_backend;
@ -184,6 +191,10 @@ static inline bool log_backend_is_active(
return backend->cb->active;
}
/**
* @}
*/
#ifdef __cplusplus
}
#endif

View file

@ -12,6 +12,21 @@
extern "C" {
#endif
/**
* @brief Logger
* @defgroup logger Logger system
* @{
* @}
*/
/**
* @brief Logger control API
* @defgroup log_ctrl Logger control API
* @ingroup logger
* @{
*/
typedef u32_t (*timestamp_get_t)(void);
/**
@ -133,6 +148,10 @@ void log_backend_disable(struct log_backend const *const backend);
#define LOG_PROCESS() false
#endif
/**
* @}
*/
#ifdef __cplusplus
}
#endif

View file

@ -15,6 +15,13 @@
extern "C" {
#endif
/**
* @brief Log message API
* @defgroup log_msg Log message API
* @ingroup logger
* @{
*/
/** @brief Maximum number of arguments in the standard log entry. */
#define LOG_MAX_NARGS 6
@ -102,7 +109,7 @@ _Static_assert(sizeof(struct log_msg_hexdump_hdr) == sizeof(u16_t),
/** Log message header structure */
struct log_msg_hdr {
atomic_t ref_cnt; /*!< Reference counter for tracking message users. */
union {
union log_msg_hdr_params {
struct log_msg_generic_hdr generic;
struct log_msg_std_hdr std;
struct log_msg_hexdump_hdr hexdump;
@ -137,7 +144,7 @@ union log_msg_head_data {
/** @brief Data part of extended log message. */
struct log_msg_ext_head_data {
struct log_msg_cont *next;
union {
union log_msg_ext_head_data_data {
struct log_msg_std_ext_head_data std;
u8_t bytes[LOG_MSG_HEXDUMP_BYTES_HEAD_CHUNK];
} data;
@ -148,7 +155,7 @@ struct log_msg {
struct log_msg *next; /*!< Used by logger core list.*/
struct log_msg_hdr hdr; /*!< Message header. */
union {
union log_msg_data {
union log_msg_head_data data;
struct log_msg_ext_head_data ext;
} data; /*!< Message data. */
@ -161,7 +168,7 @@ _Static_assert(sizeof(union log_msg_head_data) ==
/** @brief Chunks following message head when message is extended. */
struct log_msg_cont {
struct log_msg_cont *next; /*!< Pointer to the next chunk. */
union {
union log_msg_cont_data {
u32_t args[ARGS_CONT_MSG];
u8_t bytes[HEXDUMP_BYTES_CONT_MSG];
} data;
@ -517,6 +524,10 @@ struct log_msg *log_msg_create_n(const char *str,
u32_t *args,
u32_t nargs);
/**
* @}
*/
#ifdef __cplusplus
}
#endif

View file

@ -12,6 +12,13 @@
extern "C" {
#endif
/**
* @brief Log output API
* @defgroup log_output Log output API
* @ingroup logger
* @{
*/
/** @brief Flag forcing ANSI escape code colors, red (errors), yellow
* (warnings).
*/
@ -58,6 +65,11 @@ void log_output_msg_process(struct log_msg *msg,
*/
void log_output_timestamp_freq_set(u32_t freq);
/**
* @}
*/
#ifdef __cplusplus
}
#endif