logging: subsystem major redesign

Adding new implementation of logging subsystem. New features
includes: support for multiple backends, improving performance
by deferring log processing to the known context, adding
timestamps and logs filtering options (compile time, runtime,
module level, instance level). Console backend added as the
example backend.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruściński 2018-05-16 08:50:33 +02:00 committed by Anas Nashif
commit bbeef4155c
22 changed files with 3212 additions and 1 deletions

55
subsys/logging/log_list.h Normal file
View file

@ -0,0 +1,55 @@
/*
* Copyright (c) 2018 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef LOG_LIST_H_
#define LOG_LIST_H_
#include <logging/log_msg.h>
#ifdef __cplusplus
extern "C" {
#endif
/** @brief List instance structure. */
struct log_list_t {
struct log_msg *head;
struct log_msg *tail;
};
/** @brief Initialize log list instance.
*
* @param list List instance.
*/
void log_list_init(struct log_list_t *list);
/** @brief Add item to the tail of the list.
*
* @param list List instance.
* @param msg Message.
*
*/
void log_list_add_tail(struct log_list_t *list, struct log_msg *msg);
/** @brief Remove item from the head of the list.
*
* @param list List instance.
*
* @return Message.
*/
struct log_msg *log_list_head_get(struct log_list_t *list);
/** @brief Peek item from the head of the list.
*
* @param list List instance.
*
* @return Message.
*/
struct log_msg *log_list_head_peek(struct log_list_t *list);
#ifdef __cplusplus
}
#endif
#endif /* LOG_LIST_H_ */