Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Header file for the logging subsystem. More...

Go to the source code of this file.

Macros

Standard logging
#define LOG_ERR(...)
 Writes an ERROR level message to the log.
#define LOG_WRN(...)
 Writes a WARNING level message to the log.
#define LOG_INF(...)
 Writes an INFO level message to the log.
#define LOG_DBG(...)
 Writes a DEBUG level message to the log.
#define LOG_WRN_ONCE(...)
 Writes a WARNING level message to the log on the first execution only.
Rate-limited logging

Rate-limited variants drop repeated messages so that a frequently-hit call site cannot flood the log.

Each call site is limited independently using atomic operations for thread safety, and a summary of skipped messages is emitted when logging resumes. The plain variants use the default interval LOG_RATELIMIT_INTERVAL_MS; the _RATE variants take an explicit interval.

#define LOG_RATELIMIT_INTERVAL_MS   0
 Default interval for rate-limited log messages, in milliseconds.
#define LOG_WRN_RATELIMIT(...)
 Writes a WARNING level message to the log with rate limiting.
#define LOG_ERR_RATELIMIT(...)
 Writes an ERROR level message to the log with rate limiting.
#define LOG_INF_RATELIMIT(...)
 Writes an INFO level message to the log with rate limiting.
#define LOG_DBG_RATELIMIT(...)
 Writes a DEBUG level message to the log with rate limiting.
#define LOG_HEXDUMP_ERR_RATELIMIT(_data, _length, _str)
 Writes an ERROR level hexdump message to the log with rate limiting.
#define LOG_HEXDUMP_WRN_RATELIMIT(_data, _length, _str)
 Writes a WARNING level hexdump message to the log with rate limiting.
#define LOG_HEXDUMP_INF_RATELIMIT(_data, _length, _str)
 Writes an INFO level hexdump message to the log with rate limiting.
#define LOG_HEXDUMP_DBG_RATELIMIT(_data, _length, _str)
 Writes a DEBUG level hexdump message to the log with rate limiting.
#define LOG_ERR_RATELIMIT_RATE(_rate_ms, ...)
 Writes an ERROR level message to the log with custom rate limiting.
#define LOG_WRN_RATELIMIT_RATE(_rate_ms, ...)
 Writes a WARNING level message to the log with custom rate limiting.
#define LOG_INF_RATELIMIT_RATE(_rate_ms, ...)
 Writes an INFO level message to the log with custom rate limiting.
#define LOG_DBG_RATELIMIT_RATE(_rate_ms, ...)
 Writes a DEBUG level message to the log with custom rate limiting.
#define LOG_HEXDUMP_ERR_RATELIMIT_RATE(_rate_ms, _data, _length, _str)
 Writes an ERROR level hexdump message to the log with custom rate limiting.
#define LOG_HEXDUMP_WRN_RATELIMIT_RATE(_rate_ms, _data, _length, _str)
 Writes a WARNING level hexdump message to the log with custom rate limiting.
#define LOG_HEXDUMP_INF_RATELIMIT_RATE(_rate_ms, _data, _length, _str)
 Writes an INFO level hexdump message to the log with custom rate limiting.
#define LOG_HEXDUMP_DBG_RATELIMIT_RATE(_rate_ms, _data, _length, _str)
 Writes a DEBUG level hexdump message to the log with custom rate limiting.
Raw output
#define LOG_PRINTK(...)
 Unconditionally print raw log message.
#define LOG_RAW(...)
 Unconditionally print raw log message.
Instance logging
#define LOG_INST_ERR(_log_inst, ...)
 Writes an ERROR level message associated with the instance to the log.
#define LOG_INST_WRN(_log_inst, ...)
 Writes a WARNING level message associated with the instance to the log.
#define LOG_INST_INF(_log_inst, ...)
 Writes an INFO level message associated with the instance to the log.
#define LOG_INST_DBG(_log_inst, ...)
 Writes a DEBUG level message associated with the instance to the log.
Hexdump logging
#define LOG_HEXDUMP_ERR(_data, _length, _str)
 Writes an ERROR level hexdump message to the log.
#define LOG_HEXDUMP_WRN(_data, _length, _str)
 Writes a WARNING level message to the log.
#define LOG_HEXDUMP_INF(_data, _length, _str)
 Writes an INFO level message to the log.
#define LOG_HEXDUMP_DBG(_data, _length, _str)
 Writes a DEBUG level message to the log.
Instance hexdump logging
#define LOG_INST_HEXDUMP_ERR(_log_inst, _data, _length, _str)
 Writes an ERROR hexdump message associated with the instance to the log.
#define LOG_INST_HEXDUMP_WRN(_log_inst, _data, _length, _str)
 Writes a WARNING level hexdump message associated with the instance to the log.
#define LOG_INST_HEXDUMP_INF(_log_inst, _data, _length, _str)
 Writes an INFO level hexdump message associated with the instance to the log.
#define LOG_INST_HEXDUMP_DBG(_log_inst, _data, _length, _str)
 Writes a DEBUG level hexdump message associated with the instance to the log.
Module registration
#define LOG_MODULE_REGISTER(...)
 Create module-specific state and register the module with Logger.
#define LOG_MODULE_DECLARE(...)
 Macro for declaring a log module (not registering it).
#define LOG_LEVEL_SET(level)
 Macro for setting log level in the file or function where instance logging API is used.

Detailed Description

Header file for the logging subsystem.