Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
log_ctrl.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#ifndef ZEPHYR_INCLUDE_LOGGING_LOG_CTRL_H_
7#define ZEPHYR_INCLUDE_LOGGING_LOG_CTRL_H_
8
9#include <kernel.h>
10#include <logging/log_backend.h>
11#include <logging/log_msg.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
33
39void log_core_init(void);
40
45void log_init(void);
46
56void log_thread_set(k_tid_t process_tid);
57
67 uint32_t freq);
68
79__syscall void log_panic(void);
80
89__syscall bool log_process(bool bypass);
90
96__syscall uint32_t log_buffered_cnt(void);
97
105
106
114const char *log_source_name_get(uint32_t domain_id, uint32_t source_id);
115
122const char *log_domain_name_get(uint32_t domain_id);
123
134uint32_t log_filter_get(struct log_backend const *const backend,
135 uint32_t domain_id, int16_t source_id, bool runtime);
136
148__syscall uint32_t log_filter_set(struct log_backend const *const backend,
149 uint32_t domain_id, int16_t source_id,
150 uint32_t level);
151
160void log_backend_enable(struct log_backend const *const backend,
161 void *ctx,
162 uint32_t level);
163
170void log_backend_disable(struct log_backend const *const backend);
171
172#if defined(CONFIG_LOG) && !defined(CONFIG_LOG_MINIMAL)
173#define LOG_CORE_INIT() log_core_init()
174#define LOG_INIT() log_init()
175#define LOG_PANIC() log_panic()
176#define LOG_PROCESS() log_process(false)
177#else
178#define LOG_CORE_INIT() do { } while (false)
179#define LOG_INIT() 0
180#define LOG_PANIC() /* Empty */
181#define LOG_PROCESS() false
182#endif
183
184#include <syscalls/log_ctrl.h>
185
190#ifdef __cplusplus
191}
192#endif
193
194#endif /* ZEPHYR_INCLUDE_LOGGING_LOG_CTRL_H_ */
void
Definition: eswifi_shell.c:15
uint32_t log_src_cnt_get(uint32_t domain_id)
Get number of independent logger sources (modules and instances)
void log_init(void)
Function for user initialization of the logger.
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.
void log_core_init(void)
Function system initialization of the logger.
bool log_process(bool bypass)
Process one pending log message.
void log_thread_set(k_tid_t process_tid)
Function for providing thread which is processing logs.
void log_panic(void)
Switch the logger subsystem to the panic mode.
const char * log_source_name_get(uint32_t domain_id, uint32_t source_id)
Get name of the source (module or instance).
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.
uint32_t log_buffered_cnt(void)
Return number of buffered log messages.
const char * log_domain_name_get(uint32_t domain_id)
Get name of the domain.
void log_backend_enable(struct log_backend const *const backend, void *ctx, uint32_t level)
Enable backend with initial maximum filtering level.
log_timestamp_t(* log_timestamp_get_t)(void)
Definition: log_ctrl.h:32
int log_set_timestamp_func(log_timestamp_get_t timestamp_getter, uint32_t freq)
Function for providing timestamp function.
void log_backend_disable(struct log_backend const *const backend)
Disable backend.
uint32_t log_timestamp_t
Definition: log_msg2.h:34
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__INT16_TYPE__ int16_t
Definition: stdint.h:43
Definition: thread.h:201
Logger backend structure.
Definition: log_backend.h:62