Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
Logger control API. More...
Macros | |
#define | LOG_CORE_INIT() do { } while (false) |
#define | LOG_INIT() 0 |
#define | LOG_PANIC() /* Empty */ |
#define | LOG_PROCESS() false |
Typedefs | |
typedef log_timestamp_t(* | log_timestamp_get_t) (void) |
Functions | |
void | log_core_init (void) |
Function system initialization of the logger. More... | |
void | log_init (void) |
Function for user initialization of the logger. More... | |
void | log_thread_set (k_tid_t process_tid) |
Function for providing thread which is processing logs. More... | |
int | log_set_timestamp_func (log_timestamp_get_t timestamp_getter, uint32_t freq) |
Function for providing timestamp function. More... | |
void | log_panic (void) |
Switch the logger subsystem to the panic mode. More... | |
bool | log_process (bool bypass) |
Process one pending log message. More... | |
uint32_t | log_buffered_cnt (void) |
Return number of buffered log messages. More... | |
uint32_t | log_src_cnt_get (uint32_t domain_id) |
Get number of independent logger sources (modules and instances) More... | |
const char * | log_source_name_get (uint32_t domain_id, uint32_t source_id) |
Get name of the source (module or instance). More... | |
const char * | log_domain_name_get (uint32_t domain_id) |
Get name of the domain. More... | |
uint32_t | log_filter_get (struct log_backend const *const backend, uint32_t domain_id, int16_t source_id, bool runtime) |
Get source filter for the provided backend. More... | |
uint32_t | log_filter_set (struct log_backend const *const backend, uint32_t domain_id, int16_t source_id, uint32_t level) |
Set filter on given source for the provided backend. More... | |
void | log_backend_enable (struct log_backend const *const backend, void *ctx, uint32_t level) |
Enable backend with initial maximum filtering level. More... | |
void | log_backend_disable (struct log_backend const *const backend) |
Disable backend. More... | |
Logger control API.
#define LOG_CORE_INIT | ( | ) | do { } while (false) |
#include <include/logging/log_ctrl.h>
#define LOG_INIT | ( | ) | 0 |
#include <include/logging/log_ctrl.h>
#define LOG_PANIC | ( | ) | /* Empty */ |
#include <include/logging/log_ctrl.h>
#define LOG_PROCESS | ( | ) | false |
#include <include/logging/log_ctrl.h>
typedef log_timestamp_t(* log_timestamp_get_t) (void) |
#include <include/logging/log_ctrl.h>
void log_backend_disable | ( | struct log_backend const *const | backend | ) |
void log_backend_enable | ( | struct log_backend const *const | backend, |
void * | ctx, | ||
uint32_t | level | ||
) |
#include <include/logging/log_ctrl.h>
Enable backend with initial maximum filtering level.
backend | Backend instance. |
ctx | User context. |
level | Severity level. |
#include <include/logging/log_ctrl.h>
Return number of buffered log messages.
#include <include/logging/log_ctrl.h>
Function system initialization of the logger.
Function is called during start up to allow logging before user can explicitly initialize the logger.
const char * log_domain_name_get | ( | uint32_t | domain_id | ) |
#include <include/logging/log_ctrl.h>
Get name of the domain.
domain_id | Domain ID. |
uint32_t log_filter_get | ( | struct log_backend const *const | backend, |
uint32_t | domain_id, | ||
int16_t | source_id, | ||
bool | runtime | ||
) |
#include <include/logging/log_ctrl.h>
Get source filter for the provided backend.
backend | Backend instance. |
domain_id | ID of the domain. |
source_id | Source (module or instance) ID. |
runtime | True for runtime filter or false for compiled in. |
uint32_t log_filter_set | ( | struct log_backend const *const | backend, |
uint32_t | domain_id, | ||
int16_t | source_id, | ||
uint32_t | level | ||
) |
#include <include/logging/log_ctrl.h>
Set filter on given source for the provided backend.
backend | Backend instance. NULL for all backends. |
domain_id | ID of the domain. |
source_id | Source (module or instance) ID. |
level | Severity level. |
#include <include/logging/log_ctrl.h>
Function for user initialization of the logger.
#include <include/logging/log_ctrl.h>
Switch the logger subsystem to the panic mode.
Returns immediately if the logger is already in the panic mode.
On panic the logger subsystem informs all backends about panic mode. Backends must switch to blocking mode or halt. All pending logs are flushed after switching to panic mode. In panic mode, all log messages must be processed in the context of the call.
#include <include/logging/log_ctrl.h>
Process one pending log message.
bypass | If true message is released without being processed. |
true | There is more messages pending to be processed. |
false | No messages pending. |
int log_set_timestamp_func | ( | log_timestamp_get_t | timestamp_getter, |
uint32_t | freq | ||
) |
#include <include/logging/log_ctrl.h>
Function for providing timestamp function.
timestamp_getter | Timestamp function. |
freq | Timestamping frequency. |
#include <include/logging/log_ctrl.h>
Get name of the source (module or instance).
domain_id | Domain ID. |
source_id | Source ID. |
#include <include/logging/log_ctrl.h>
Get number of independent logger sources (modules and instances)
domain_id | Domain ID. |
#include <include/logging/log_ctrl.h>
Function for providing thread which is processing logs.
See CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD.
process_tid | Process thread id. Used to wake up the thread. |