6#ifndef ZEPHYR_INCLUDE_LOGGING_LOG_CORE_H_
7#define ZEPHYR_INCLUDE_LOGGING_LOG_CORE_H_
18#define LOG_LEVEL_NONE 0U
19#define LOG_LEVEL_ERR 1U
20#define LOG_LEVEL_WRN 2U
21#define LOG_LEVEL_INF 3U
22#define LOG_LEVEL_DBG 4U
29#define CONFIG_LOG_DEFAULT_LEVEL 0U
30#define CONFIG_LOG_MAX_LEVEL 0U
33#if !defined(CONFIG_LOG) || defined(CONFIG_LOG_MINIMAL)
34#define CONFIG_LOG_DOMAIN_ID 0U
37#define LOG_FUNCTION_PREFIX_MASK \
38 (((uint32_t)IS_ENABLED(CONFIG_LOG_FUNC_NAME_PREFIX_ERR) << \
40 ((uint32_t)IS_ENABLED(CONFIG_LOG_FUNC_NAME_PREFIX_WRN) << \
42 ((uint32_t)IS_ENABLED(CONFIG_LOG_FUNC_NAME_PREFIX_INF) << \
44 ((uint32_t)IS_ENABLED(CONFIG_LOG_FUNC_NAME_PREFIX_DBG) << LOG_LEVEL_DBG))
50#define Z_LOG_RESOLVED_LEVEL(_level, _default) \
51 Z_LOG_RESOLVED_LEVEL1(_level, _default)
53#define Z_LOG_RESOLVED_LEVEL1(_level, _default) \
54 __COND_CODE(_LOG_XXXX##_level, (_level), (_default))
56#define _LOG_XXXX0 _LOG_YYYY,
57#define _LOG_XXXX0U _LOG_YYYY,
58#define _LOG_XXXX1 _LOG_YYYY,
59#define _LOG_XXXX1U _LOG_YYYY,
60#define _LOG_XXXX2 _LOG_YYYY,
61#define _LOG_XXXX2U _LOG_YYYY,
62#define _LOG_XXXX3 _LOG_YYYY,
63#define _LOG_XXXX3U _LOG_YYYY,
64#define _LOG_XXXX4 _LOG_YYYY,
65#define _LOG_XXXX4U _LOG_YYYY,
81#define Z_LOG_EVAL(_eval_level, _iftrue, _iffalse) \
82 Z_LOG_EVAL1(_eval_level, _iftrue, _iffalse)
84#define Z_LOG_EVAL1(_eval_level, _iftrue, _iffalse) \
85 __COND_CODE(_LOG_ZZZZ##_eval_level, _iftrue, _iffalse)
87#define _LOG_ZZZZ1 _LOG_YYYY,
88#define _LOG_ZZZZ1U _LOG_YYYY,
89#define _LOG_ZZZZ2 _LOG_YYYY,
90#define _LOG_ZZZZ2U _LOG_YYYY,
91#define _LOG_ZZZZ3 _LOG_YYYY,
92#define _LOG_ZZZZ3U _LOG_YYYY,
93#define _LOG_ZZZZ4 _LOG_YYYY,
94#define _LOG_ZZZZ4U _LOG_YYYY,
101#define _LOG_LEVEL() Z_LOG_RESOLVED_LEVEL(LOG_LEVEL, CONFIG_LOG_DEFAULT_LEVEL)
109#define LOG_CONST_ID_GET(_addr) \
110 COND_CODE_1(CONFIG_LOG, ((__log_level ? log_const_source_id(_addr) : 0)), (0))
116#define LOG_CURRENT_MODULE_ID() (__log_level != 0 ? \
117 log_const_source_id(__log_current_const_data) : 0U)
123#define LOG_CURRENT_DYNAMIC_DATA_ADDR() (__log_level ? \
124 __log_current_dynamic_data : (struct log_source_dynamic_data *)0U)
130#define LOG_DYNAMIC_ID_GET(_addr) \
131 COND_CODE_1(CONFIG_LOG, ((__log_level ? log_dynamic_source_id(_addr) : 0)), (0))
134#define Z_LOG_FUNC_PREFIX_0U 0
135#define Z_LOG_FUNC_PREFIX_1U COND_CODE_1(CONFIG_LOG_FUNC_NAME_PREFIX_ERR, (1), (0))
136#define Z_LOG_FUNC_PREFIX_2U COND_CODE_1(CONFIG_LOG_FUNC_NAME_PREFIX_WRN, (1), (0))
137#define Z_LOG_FUNC_PREFIX_3U COND_CODE_1(CONFIG_LOG_FUNC_NAME_PREFIX_INF, (1), (0))
138#define Z_LOG_FUNC_PREFIX_4U COND_CODE_1(CONFIG_LOG_FUNC_NAME_PREFIX_DBG, (1), (0))
149#define Z_LOG_STR_WITH_PREFIX2(...) \
150 "%s: " GET_ARG_N(1, __VA_ARGS__), (const char *)__func__\
151 COND_CODE_0(NUM_VA_ARGS_LESS_1(__VA_ARGS__),\
153 (, GET_ARGS_LESS_N(1, __VA_ARGS__))\
159#define Z_LOG_STR_WITH_PREFIX(...) \
160 COND_CODE_0(NUM_VA_ARGS_LESS_1(_, ##__VA_ARGS__), \
161 ("%s", (const char *)__func__), \
162 (Z_LOG_STR_WITH_PREFIX2(__VA_ARGS__)))
169#define Z_LOG_STR(_level, ...) \
170 COND_CODE_1(UTIL_CAT(Z_LOG_FUNC_PREFIX_##_level), \
171 (Z_LOG_STR_WITH_PREFIX(__VA_ARGS__)), (__VA_ARGS__))
177#define Z_LOG_NARGS_POSTFIX_IMPL( \
179 _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \
180 _11, _12, _13, _14, N, ...) N
190#define Z_LOG_NARGS_POSTFIX(...) \
191 Z_LOG_NARGS_POSTFIX_IMPL(__VA_ARGS__, LONG, LONG, LONG, LONG, LONG, \
192 LONG, LONG, LONG, LONG, LONG, LONG, LONG, 3, 2, 1, 0, ~)
194#define Z_LOG_INTERNAL_X(N, ...) UTIL_CAT(_LOG_INTERNAL_, N)(__VA_ARGS__)
196#define Z_LOG_INTERNAL2(is_user_context, _src_level, ...) do { \
197 if (is_user_context) { \
198 log_from_user(_src_level, __VA_ARGS__); \
199 } else if (IS_ENABLED(CONFIG_LOG_IMMEDIATE)) { \
200 log_string_sync(_src_level, __VA_ARGS__); \
202 Z_LOG_INTERNAL_X(Z_LOG_NARGS_POSTFIX(__VA_ARGS__), \
203 _src_level, __VA_ARGS__); \
207#define Z_LOG_INTERNAL(is_user_context, _level, _source, _dsource, ...) do { \
209 IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) ? \
210 LOG_DYNAMIC_ID_GET(_dsource) : LOG_CONST_ID_GET(_source); \
211 struct log_msg_ids src_level = { \
213 .domain_id = CONFIG_LOG_DOMAIN_ID, \
214 .source_id = src_id \
216 Z_LOG_INTERNAL2(is_user_context, src_level, \
217 Z_LOG_STR(_level, __VA_ARGS__)); \
220#define _LOG_INTERNAL_0(_src_level, _str) \
221 log_0(_str, _src_level)
223#define _LOG_INTERNAL_1(_src_level, _str, _arg0) \
224 log_1(_str, (log_arg_t)(_arg0), _src_level)
226#define _LOG_INTERNAL_2(_src_level, _str, _arg0, _arg1) \
227 log_2(_str, (log_arg_t)(_arg0), (log_arg_t)(_arg1), _src_level)
229#define _LOG_INTERNAL_3(_src_level, _str, _arg0, _arg1, _arg2) \
230 log_3(_str, (log_arg_t)(_arg0), (log_arg_t)(_arg1), (log_arg_t)(_arg2), _src_level)
232#define __LOG_ARG_CAST(_x) (log_arg_t)(_x)
234#define __LOG_ARGUMENTS(...) FOR_EACH(__LOG_ARG_CAST, (,), __VA_ARGS__)
236#define _LOG_INTERNAL_LONG(_src_level, _str, ...) \
238 log_arg_t args[] = {__LOG_ARGUMENTS(__VA_ARGS__)};\
239 log_n(_str, args, ARRAY_SIZE(args), _src_level); \
242#define Z_LOG_LEVEL_CHECK(_level, _check_level, _default_level) \
243 (_level <= Z_LOG_RESOLVED_LEVEL(_check_level, _default_level))
245#define Z_LOG_CONST_LEVEL_CHECK(_level) \
246 (IS_ENABLED(CONFIG_LOG) && \
247 (Z_LOG_LEVEL_CHECK(_level, CONFIG_LOG_OVERRIDE_LEVEL, LOG_LEVEL_NONE) \
249 ((IS_ENABLED(CONFIG_LOG_OVERRIDE_LEVEL) == false) && \
250 (_level <= __log_level) && \
251 (_level <= CONFIG_LOG_MAX_LEVEL) \
258void z_log_minimal_hexdump_print(
int level,
const void *
data,
size_t size);
259void z_log_minimal_vprintk(
const char *fmt, va_list ap);
260void z_log_minimal_printk(
const char *fmt, ...);
262#define Z_LOG_TO_PRINTK(_level, fmt, ...) do { \
263 z_log_minimal_printk("%c: " fmt "\n", \
264 z_log_minimal_level_to_char(_level), \
268#define Z_LOG_TO_VPRINTK(_level, fmt, valist) do { \
269 z_log_minimal_printk("%c: ", z_log_minimal_level_to_char(_level)); \
270 z_log_minimal_vprintk(fmt, valist); \
271 z_log_minimal_printk("\n"); \
274static inline char z_log_minimal_level_to_char(
int level)
290#define Z_LOG_INST(_inst) COND_CODE_1(CONFIG_LOG, (_inst), NULL)
295#define Z_LOG2(_level, _source, _dsource, ...) do { \
296 if (!Z_LOG_CONST_LEVEL_CHECK(_level)) { \
299 if (IS_ENABLED(CONFIG_LOG_MINIMAL)) { \
300 Z_LOG_TO_PRINTK(_level, __VA_ARGS__); \
304 bool is_user_context = k_is_user_context(); \
305 uint32_t filters = IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) ? \
306 (_dsource)->filters : 0;\
307 if (IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) && !is_user_context && \
308 _level > Z_LOG_RUNTIME_FILTER(filters)) { \
311 if (IS_ENABLED(CONFIG_LOG2)) { \
313 void *_src = IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) ? \
314 (void *)_dsource : (void *)_source; \
315 Z_LOG_MSG2_CREATE(UTIL_NOT(IS_ENABLED(CONFIG_USERSPACE)), _mode, \
316 CONFIG_LOG_DOMAIN_ID, _src, _level, NULL,\
319 Z_LOG_INTERNAL(is_user_context, _level, \
320 _source, _dsource, __VA_ARGS__);\
326 z_log_printf_arg_checker(__VA_ARGS__); \
330#define Z_LOG(_level, ...) \
331 Z_LOG2(_level, __log_current_const_data, __log_current_dynamic_data, __VA_ARGS__)
333#define Z_LOG_INSTANCE(_level, _inst, ...) \
335 COND_CODE_1(CONFIG_LOG_RUNTIME_FILTERING, (NULL), (Z_LOG_INST(_inst))), \
336 (struct log_source_dynamic_data *)COND_CODE_1( \
337 CONFIG_LOG_RUNTIME_FILTERING, \
338 (Z_LOG_INST(_inst)), (NULL)), \
344#define Z_LOG_HEXDUMP2(_level, _source, _dsource, _data, _len, ...) do { \
345 const char *_str = GET_ARG_N(1, __VA_ARGS__); \
346 if (!Z_LOG_CONST_LEVEL_CHECK(_level)) { \
349 bool is_user_context = k_is_user_context(); \
350 uint32_t filters = IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) ? \
351 (_dsource)->filters : 0;\
353 if (IS_ENABLED(CONFIG_LOG_MINIMAL)) { \
354 Z_LOG_TO_PRINTK(_level, "%s", _str); \
355 z_log_minimal_hexdump_print(_level, \
356 (const char *)_data, _len);\
359 if (IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) && !is_user_context && \
360 _level > Z_LOG_RUNTIME_FILTER(filters)) { \
363 if (IS_ENABLED(CONFIG_LOG2)) { \
365 void *_src = IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) ? \
366 (void *)_dsource : (void *)_source; \
367 Z_LOG_MSG2_CREATE(UTIL_NOT(IS_ENABLED(CONFIG_USERSPACE)), mode, \
368 CONFIG_LOG_DOMAIN_ID, _src, _level, \
370 COND_CODE_0(NUM_VA_ARGS_LESS_1(_, ##__VA_ARGS__), \
372 (COND_CODE_0(NUM_VA_ARGS_LESS_1(__VA_ARGS__), \
373 ("%s", __VA_ARGS__), (__VA_ARGS__)))));\
377 IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) ? \
378 LOG_DYNAMIC_ID_GET(_dsource) : LOG_CONST_ID_GET(_source);\
379 struct log_msg_ids src_level = { \
381 .domain_id = CONFIG_LOG_DOMAIN_ID, \
382 .source_id = src_id, \
384 if (is_user_context) { \
385 log_hexdump_from_user(src_level, _str, \
386 (const char *)_data, _len); \
387 } else if (IS_ENABLED(CONFIG_LOG_IMMEDIATE)) { \
388 log_hexdump_sync(src_level, _str, (const char *)_data, _len); \
390 log_hexdump(_str, (const char *)_data, _len, src_level); \
394#define Z_LOG_HEXDUMP(_level, _data, _length, ...) \
395 Z_LOG_HEXDUMP2(_level, \
396 __log_current_const_data, \
397 __log_current_dynamic_data, \
398 _data, _length, __VA_ARGS__)
400#define Z_LOG_HEXDUMP_INSTANCE(_level, _inst, _data, _length, _str) \
401 Z_LOG_HEXDUMP2(_level, \
402 COND_CODE_1(CONFIG_LOG_RUNTIME_FILTERING, (NULL), (Z_LOG_INST(_inst))), \
403 (struct log_source_dynamic_data *)COND_CODE_1( \
404 CONFIG_LOG_RUNTIME_FILTERING, \
405 (Z_LOG_INST(_inst)), (NULL)), \
406 _data, _length, _str)
413#define LOG_LEVEL_BITS 3U
416#define LOG_FILTER_SLOT_SIZE LOG_LEVEL_BITS
419#define LOG_FILTERS_NUM_OF_SLOTS (32 / LOG_FILTER_SLOT_SIZE)
422#define LOG_FILTER_SLOT_MASK (BIT(LOG_FILTER_SLOT_SIZE) - 1U)
428#define LOG_FILTER_SLOT_SHIFT(_id) (LOG_FILTER_SLOT_SIZE * (_id))
430#define LOG_FILTER_SLOT_GET(_filters, _id) \
431 ((*(_filters) >> LOG_FILTER_SLOT_SHIFT(_id)) & LOG_FILTER_SLOT_MASK)
433#define LOG_FILTER_SLOT_SET(_filters, _id, _filter) \
435 *(_filters) &= ~(LOG_FILTER_SLOT_MASK << \
436 LOG_FILTER_SLOT_SHIFT(_id)); \
437 *(_filters) |= ((_filter) & LOG_FILTER_SLOT_MASK) << \
438 LOG_FILTER_SLOT_SHIFT(_id); \
441#define LOG_FILTER_AGGR_SLOT_IDX 0
443#define LOG_FILTER_AGGR_SLOT_GET(_filters) \
444 LOG_FILTER_SLOT_GET(_filters, LOG_FILTER_AGGR_SLOT_IDX)
446#define LOG_FILTER_FIRST_BACKEND_SLOT_IDX 1
452#define Z_LOG_RUNTIME_FILTER(_filter) \
453 LOG_FILTER_SLOT_GET(&_filter, LOG_FILTER_AGGR_SLOT_IDX)
458#define LOG_LEVEL_INTERNAL_RAW_STRING LOG_LEVEL_NONE
470#define Z_LOG_PRINTK(...) do { \
471 if (IS_ENABLED(CONFIG_LOG_MINIMAL) || !IS_ENABLED(CONFIG_LOG2)) { \
472 z_log_minimal_printk(__VA_ARGS__); \
477 z_log_printf_arg_checker(__VA_ARGS__); \
479 Z_LOG_MSG2_CREATE(!IS_ENABLED(CONFIG_USERSPACE), _mode, \
480 CONFIG_LOG_DOMAIN_ID, NULL, \
481 LOG_LEVEL_INTERNAL_RAW_STRING, NULL, 0, __VA_ARGS__);\
492 return __log_const_start[source_id].
name;
502 return __log_const_start[source_id].
level;
532#define LOG_ITEM_DYNAMIC_DATA(_name) UTIL_CAT(log_dynamic_, _name)
534#define LOG_INSTANCE_DYNAMIC_DATA(_module_name, _inst) \
535 LOG_ITEM_DYNAMIC_DATA(LOG_INSTANCE_FULL_NAME(_module_name, _inst))
545 return &__log_dynamic_start[source_id].
filters;
562void z_log_runtime_filters_init(
void);
565void z_log_notify_backend_enabled(
void);
568static inline __printf_like(1, 2)
569void z_log_printf_arg_checker(const
char *fmt, ...)
703 const char *fmt, va_list ap);
741void z_log_dropped(
void);
747uint32_t z_log_dropped_read_and_clear(
void);
754bool z_log_dropped_pending(
void);
766 const
char *fmt, ...);
769__syscall
void z_log_string_from_user(
uint32_t src_level_val, const
char *str);
798__syscall
void z_log_hexdump_from_user(
uint32_t src_level_val,
799 const
char *metadata,
808#define Z_LOG_VA(_level, _str, _valist, _argnum, _strdup_action)\
810 __log_current_const_data, \
811 __log_current_dynamic_data, \
812 _str, _valist, _argnum, _strdup_action)
814#define __LOG_VA(_level, _source, _dsource, _str, _valist, _argnum, _strdup_action) do { \
815 if (!Z_LOG_CONST_LEVEL_CHECK(_level)) { \
818 if (IS_ENABLED(CONFIG_LOG_MINIMAL)) { \
819 Z_LOG_TO_VPRINTK(_level, _str, _valist); \
823 bool is_user_context = k_is_user_context(); \
824 uint32_t filters = IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) ? \
825 _dsource->filters : 0;\
826 if (IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) && !is_user_context && \
827 _level > Z_LOG_RUNTIME_FILTER(filters)) { \
830 if (IS_ENABLED(CONFIG_LOG2)) { \
831 z_log_msg2_runtime_vcreate(CONFIG_LOG_DOMAIN_ID, _source, \
832 _level, NULL, 0, _str, _valist); \
836 IS_ENABLED(CONFIG_LOG_RUNTIME_FILTERING) ? \
837 LOG_DYNAMIC_ID_GET(_dsource) : LOG_CONST_ID_GET(_source);\
838 struct log_msg_ids src_level = { \
840 .domain_id = CONFIG_LOG_DOMAIN_ID, \
843 __LOG_INTERNAL_VA(is_user_context, \
845 _str, _valist, _argnum, \
865#ifndef CONFIG_LOG_MINIMAL
866 char *z_log_strdup(
const char *str);
868 if (msk & (1 << idx)) {
869 const char *str = (
const char *)param;
887#define __LOG_INTERNAL_VA(is_user_context, _src_level, _str, _valist, \
888 _argnum, _strdup_action) \
890 if (is_user_context) { \
891 log_generic_from_user(_src_level, _str, _valist); \
892 } else if (IS_ENABLED(CONFIG_LOG_IMMEDIATE)) { \
893 log_generic(_src_level, _str, _valist, _strdup_action); \
894 } else if (_argnum == 0) { \
895 _LOG_INTERNAL_0(_src_level, _str); \
897 uint32_t mask = (_strdup_action != LOG_STRDUP_SKIP) ? \
898 z_log_get_s_mask(_str, _argnum) \
901 if (_argnum == 1) { \
902 _LOG_INTERNAL_1(_src_level, _str, \
903 z_log_do_strdup(mask, 0, \
904 va_arg(_valist, log_arg_t), _strdup_action));\
905 } else if (_argnum == 2) { \
906 _LOG_INTERNAL_2(_src_level, _str, \
907 z_log_do_strdup(mask, 0, \
908 va_arg(_valist, log_arg_t), _strdup_action), \
909 z_log_do_strdup(mask, 1, \
910 va_arg(_valist, log_arg_t), _strdup_action));\
911 } else if (_argnum == 3) { \
912 _LOG_INTERNAL_3(_src_level, _str, \
913 z_log_do_strdup(mask, 0, \
914 va_arg(_valist, log_arg_t), _strdup_action), \
915 z_log_do_strdup(mask, 1, \
916 va_arg(_valist, log_arg_t), _strdup_action), \
917 z_log_do_strdup(mask, 2, \
918 va_arg(_valist, log_arg_t), _strdup_action));\
920 log_generic(_src_level, _str, _valist, _strdup_action);\
void
Definition: eswifi_shell.c:15
unsigned long log_arg_t
Log argument type.
Definition: log_msg.h:29
static uint32_t * log_dynamic_filters_get(uint32_t source_id)
Get pointer to the filter set of the log source.
Definition: log_core.h:543
uint32_t log_get_strdup_longest_string(void)
Get length of the longest string duplicated.
uint32_t log_get_strdup_pool_utilization(void)
Get maximal number of simultaneously allocated buffers for string duplicates.
void log_free(void *buf)
Free allocated buffer.
void log_hexdump_sync(struct log_msg_ids src_level, const char *metadata, const void *data, uint32_t len)
Process log hexdump message synchronously.
void log_string_sync(struct log_msg_ids src_level, const char *fmt,...)
Process log message synchronously.
#define LOG_LEVEL_INF
Definition: log_core.h:21
static void log2_generic(uint8_t level, const char *fmt, va_list ap)
Writes a generic log message to the logging v2.
Definition: log_core.h:679
uint32_t log_count_args(const char *fmt)
Returns number of arguments visible from format string.
#define CONFIG_LOG_DOMAIN_ID
Definition: log_core.h:34
void log_hexdump_from_user(struct log_msg_ids src_level, const char *metadata, const void *data, uint32_t len)
Log binary data (displayed as hexdump) from user mode context.
void log_n(const char *str, log_arg_t *args, uint32_t narg, struct log_msg_ids src_level)
Standard log with arguments list.
#define LOG_LEVEL_WRN
Definition: log_core.h:20
void log_generic(struct log_msg_ids src_level, const char *fmt, va_list ap, enum log_strdup_action strdup_action)
Writes a generic log message to the log.
uint32_t log_get_strdup_pool_current_utilization(void)
Get current number of allocated buffers for string duplicates.
static const char * log_name_get(uint32_t source_id)
Get name of the log source.
Definition: log_core.h:490
void log_generic_from_user(struct log_msg_ids src_level, const char *fmt, va_list ap)
Writes a generic log message to the log from user mode.
void log_1(const char *str, log_arg_t arg1, struct log_msg_ids src_level)
Standard log with one argument.
static uint8_t log_compiled_level_get(uint32_t source_id)
Get compiled level of the log source.
Definition: log_core.h:500
void log_3(const char *str, log_arg_t arg1, log_arg_t arg2, log_arg_t arg3, struct log_msg_ids src_level)
Standard log with three arguments.
log_strdup_action
Enum with possible actions for strdup operation.
Definition: log_core.h:464
@ LOG_STRDUP_CHECK_EXEC
Definition: log_core.h:467
@ LOG_STRDUP_EXEC
Definition: log_core.h:466
@ LOG_STRDUP_SKIP
Definition: log_core.h:465
static uint32_t log_dynamic_source_id(struct log_source_dynamic_data *data)
Get index of the log source based on the address of the dynamic data associated with the source.
Definition: log_core.h:555
#define LOG_LEVEL_ERR
Definition: log_core.h:19
void log_0(const char *str, struct log_msg_ids src_level)
Standard log with no arguments.
#define LOG_LEVEL_DBG
Definition: log_core.h:22
static uint32_t log_const_source_id(const struct log_source_const_data *data)
Get index of the log source based on the address of the constant data associated with the source.
Definition: log_core.h:512
bool log_is_strdup(const void *buf)
Check if address belongs to the memory pool used for transient.
void log_2(const char *str, log_arg_t arg1, log_arg_t arg2, struct log_msg_ids src_level)
Standard log with two arguments.
static uint32_t log_sources_count(void)
Get number of registered sources.
Definition: log_core.h:520
void log_from_user(struct log_msg_ids src_level, const char *fmt,...)
Log a message from user mode context.
void log_hexdump(const char *str, const void *data, uint32_t length, struct log_msg_ids src_level)
Hexdump log.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
Part of log message header identifying source and level.
Definition: log_msg.h:85
Constant data associated with the source of log messages.
Definition: log_instance.h:16
uint8_t level
Definition: log_instance.h:18
const char * name
Definition: log_instance.h:17
Dynamic data associated with the source of log messages.
Definition: log_instance.h:29
uint32_t filters
Definition: log_instance.h:30
static fdata_t data[2]
Definition: test_fifo_contexts.c:15