Common Logging Macros#

Core macros for printf-style and event-based logging.

These macros provide the foundation for both printf-style string logging and numeric event-based logging with compile-time argument validation.

Macros#

#define
sl_printf_common (level, fmt, ...)

Common printf-style logging macro.

#define
sl_event_common (level, event_id, ...)

Common event-based logging macro.

#define
sl_log_common_void (level, event_id, ...)

Common printf-style logging macro.

#define
#define
#define
#define
#define
#define
SL_PRINT_EVENT_INFO (event_id, ...)
#define
SL_PRINT_EVENT_DEBUG (event_id, ...)
#define
SL_PRINT_EVENT_WARN (event_id, ...)
#define
SL_PRINT_EVENT_ERROR (event_id, ...)
#define
SL_PRINT_EVENT_CRASH (event_id, ...)
#define
#define
#define
#define
#define

Macro Definition Documentation#

sl_printf_common#

#define sl_printf_common
Value:
static const char SLI_LOG_UNIQUE_NAME(logstr_)[] SL_COMPACT_STRINGS_SECTION = fmt; \
_Static_assert(SLI_LOG_COUNT_ARGS(fmt, ##__VA_ARGS__) <= SL_LOG_CONFIG_ARG, "Too many arguments!"); \
SL_CONCAT_PASTER_2(SLI_LOG_MACRO_CHOOSER1(SLI_LOG_COUNT_ARGS(fmt, ##__VA_ARGS__)), level) \
((uintptr_t)SLI_LOG_UNIQUE_NAME(logstr_), 0, ##__VA_ARGS__)

Common printf-style logging macro.

Creates a static format string in the log section and calls the appropriate logging function based on argument count. Includes compile-time validation to ensure no more than SL_LOG_CONFIG_ARG arguments are provided.


sl_event_common#

#define sl_event_common
Value:
_Static_assert(SLI_LOG_COUNT_ARGS(event_id, ##__VA_ARGS__) <= SL_LOG_CONFIG_ARG, "Too many arguments!"); \
SL_CONCAT_PASTER_2(SLI_LOG_MACRO_CHOOSER1(SLI_LOG_COUNT_ARGS(event_id, ##__VA_ARGS__)), level) \
(event_id, 1, ##__VA_ARGS__)

Common event-based logging macro.

Logs a numeric event ID with optional arguments. Includes compile-time validation to ensure no more than SL_LOG_CONFIG_ARG arguments are provided.


sl_log_common_void#

#define sl_log_common_void
Value:
_Static_assert(SLI_LOG_COUNT_ARGS(event_id, ##__VA_ARGS__) <= SL_LOG_CONFIG_ARG, "Too many arguments!"); \
SL_CONCAT_PASTER_2(SLI_LOG_VOID_MACRO_CHOOSER1(SLI_LOG_COUNT_ARGS(event_id, ##__VA_ARGS__)), level) \
(event_id, 1, ##__VA_ARGS__)

Common printf-style logging macro.

This apis discards the string provided by the user and and send empty string address magic word


SL_PRINT_STRING_INFO#

#define SL_PRINT_STRING_INFO
Value:
(fmt, ...)

SL_PRINT_STRING_DEBUG#

#define SL_PRINT_STRING_DEBUG
Value:
(fmt, ...)

SL_PRINT_STRING_WARN#

#define SL_PRINT_STRING_WARN
Value:
(fmt, ...)

SL_PRINT_STRING_ERROR#

#define SL_PRINT_STRING_ERROR
Value:
(fmt, ...)

SL_PRINT_STRING_CRASH#

#define SL_PRINT_STRING_CRASH
Value:
(fmt, ...)

SL_PRINT_EVENT_INFO#

#define SL_PRINT_EVENT_INFO
Value:
(event_id, ...)

SL_PRINT_EVENT_DEBUG#

#define SL_PRINT_EVENT_DEBUG
Value:
(event_id, ...)

SL_PRINT_EVENT_WARN#

#define SL_PRINT_EVENT_WARN
Value:
(event_id, ...)

SL_PRINT_EVENT_ERROR#

#define SL_PRINT_EVENT_ERROR
Value:
(event_id, ...)

SL_PRINT_EVENT_CRASH#

#define SL_PRINT_EVENT_CRASH
Value:
(event_id, ...)

SL_PRINT_FMT_INFO#

#define SL_PRINT_FMT_INFO
Value:
(fmt, ...)

SL_PRINT_FMT_DEBUG#

#define SL_PRINT_FMT_DEBUG
Value:
(fmt, ...)

SL_PRINT_FMT_WARN#

#define SL_PRINT_FMT_WARN
Value:
(fmt, ...)

SL_PRINT_FMT_ERROR#

#define SL_PRINT_FMT_ERROR
Value:
(fmt, ...)

SL_PRINT_FMT_CRASH#

#define SL_PRINT_FMT_CRASH
Value:
(fmt, ...)