Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
|
|
4.2.99 |
Logger API. More...
Macros | |
#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. | |
#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, ...) |
Rate-limited logging macros with custom rate. | |
#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. | |
#define | LOG_PRINTK(...) |
Unconditionally print raw log message. | |
#define | LOG_RAW(...) |
Unconditionally print raw log message. | |
#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. | |
#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. | |
#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. | |
#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. |
Logger API.
#define LOG_DBG | ( | ... | ) |
#include <zephyr/logging/log.h>
Writes a DEBUG level message to the log.
It's meant to write developer oriented information.
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_DBG_RATELIMIT | ( | ... | ) |
#include <zephyr/logging/log.h>
Writes a DEBUG level message to the log with rate limiting.
It's meant to write developer oriented information with rate limiting to prevent log flooding. The message will be logged at most once per default interval (see CONFIG_LOG_RATELIMIT_INTERVAL_MS).
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_DBG_RATELIMIT_RATE | ( | _rate_ms, | |
... ) |
#include <zephyr/logging/log.h>
Writes a DEBUG level message to the log with custom rate limiting.
It's meant to write developer oriented information with rate limiting to prevent log flooding. The message will be logged at most once per specified interval.
_rate_ms | Minimum interval in milliseconds between log messages. |
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_ERR | ( | ... | ) |
#include <zephyr/logging/log.h>
Writes an ERROR level message to the log.
It's meant to report severe errors, such as those from which it's not possible to recover.
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_ERR_RATELIMIT | ( | ... | ) |
#include <zephyr/logging/log.h>
Writes an ERROR level message to the log with rate limiting.
It's meant to report severe errors, such as those from which it's not possible to recover, but with rate limiting to prevent log flooding. The message will be logged at most once per default interval (see CONFIG_LOG_RATELIMIT_INTERVAL_MS).
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_ERR_RATELIMIT_RATE | ( | _rate_ms, | |
... ) |
#include <zephyr/logging/log.h>
Rate-limited logging macros with custom rate.
These macros provide rate-limited logging functionality with custom rate intervals. They take an explicit rate parameter (in milliseconds) that specifies the minimum interval between log messages.
Writes an ERROR level message to the log with custom rate limiting.
It's meant to report severe errors, such as those from which it's not possible to recover, but with rate limiting to prevent log flooding. The message will be logged at most once per specified interval.
_rate_ms | Minimum interval in milliseconds between log messages. |
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_HEXDUMP_DBG | ( | _data, | |
_length, | |||
_str ) |
#include <zephyr/logging/log.h>
Writes a DEBUG level message to the log.
It's meant to write developer oriented information.
_data | Pointer to the data to be logged. |
_length | Length of data (in bytes). |
_str | Persistent, raw string. |
#define LOG_HEXDUMP_DBG_RATELIMIT | ( | _data, | |
_length, | |||
_str ) |
#include <zephyr/logging/log.h>
Writes a DEBUG level hexdump message to the log with rate limiting.
It's meant to write developer oriented information with rate limiting to prevent log flooding. The message will be logged at most once per default interval (see CONFIG_LOG_RATELIMIT_INTERVAL_MS).
_data | Pointer to the data to be logged. |
_length | Length of data (in bytes). |
_str | Persistent, raw string. |
#define LOG_HEXDUMP_DBG_RATELIMIT_RATE | ( | _rate_ms, | |
_data, | |||
_length, | |||
_str ) |
#include <zephyr/logging/log.h>
Writes a DEBUG level hexdump message to the log with custom rate limiting.
It's meant to write developer oriented information with rate limiting to prevent log flooding. The message will be logged at most once per specified interval.
_rate_ms | Minimum interval in milliseconds between log messages. |
_data | Pointer to the data to be logged. |
_length | Length of data (in bytes). |
_str | Persistent, raw string. |
#define LOG_HEXDUMP_ERR | ( | _data, | |
_length, | |||
_str ) |
#include <zephyr/logging/log.h>
Writes an ERROR level hexdump message to the log.
It's meant to report severe errors, such as those from which it's not possible to recover.
_data | Pointer to the data to be logged. |
_length | Length of data (in bytes). |
_str | Persistent, raw string. |
#define LOG_HEXDUMP_ERR_RATELIMIT | ( | _data, | |
_length, | |||
_str ) |
#include <zephyr/logging/log.h>
Writes an ERROR level hexdump message to the log with rate limiting.
It's meant to report severe errors, such as those from which it's not possible to recover, but with rate limiting to prevent log flooding. The message will be logged at most once per default interval (see CONFIG_LOG_RATELIMIT_INTERVAL_MS).
_data | Pointer to the data to be logged. |
_length | Length of data (in bytes). |
_str | Persistent, raw string. |
#define LOG_HEXDUMP_ERR_RATELIMIT_RATE | ( | _rate_ms, | |
_data, | |||
_length, | |||
_str ) |
#include <zephyr/logging/log.h>
Writes an ERROR level hexdump message to the log with custom rate limiting.
It's meant to report severe errors, such as those from which it's not possible to recover, but with rate limiting to prevent log flooding. The message will be logged at most once per specified interval.
_rate_ms | Minimum interval in milliseconds between log messages. |
_data | Pointer to the data to be logged. |
_length | Length of data (in bytes). |
_str | Persistent, raw string. |
#define LOG_HEXDUMP_INF | ( | _data, | |
_length, | |||
_str ) |
#include <zephyr/logging/log.h>
Writes an INFO level message to the log.
It's meant to write generic user oriented messages.
_data | Pointer to the data to be logged. |
_length | Length of data (in bytes). |
_str | Persistent, raw string. |
#define LOG_HEXDUMP_INF_RATELIMIT | ( | _data, | |
_length, | |||
_str ) |
#include <zephyr/logging/log.h>
Writes an INFO level hexdump message to the log with rate limiting.
It's meant to write generic user oriented messages with rate limiting to prevent log flooding. The message will be logged at most once per default interval (see CONFIG_LOG_RATELIMIT_INTERVAL_MS).
_data | Pointer to the data to be logged. |
_length | Length of data (in bytes). |
_str | Persistent, raw string. |
#define LOG_HEXDUMP_INF_RATELIMIT_RATE | ( | _rate_ms, | |
_data, | |||
_length, | |||
_str ) |
#include <zephyr/logging/log.h>
Writes an INFO level hexdump message to the log with custom rate limiting.
It's meant to write generic user oriented messages with rate limiting to prevent log flooding. The message will be logged at most once per specified interval.
_rate_ms | Minimum interval in milliseconds between log messages. |
_data | Pointer to the data to be logged. |
_length | Length of data (in bytes). |
_str | Persistent, raw string. |
#define LOG_HEXDUMP_WRN | ( | _data, | |
_length, | |||
_str ) |
#include <zephyr/logging/log.h>
Writes a WARNING level message to the log.
It's meant to register messages related to unusual situations that are not necessarily errors.
_data | Pointer to the data to be logged. |
_length | Length of data (in bytes). |
_str | Persistent, raw string. |
#define LOG_HEXDUMP_WRN_RATELIMIT | ( | _data, | |
_length, | |||
_str ) |
#include <zephyr/logging/log.h>
Writes a WARNING level hexdump message to the log with rate limiting.
It's meant to register messages related to unusual situations that are not necessarily errors, but with rate limiting to prevent log flooding. The message will be logged at most once per default interval (see CONFIG_LOG_RATELIMIT_INTERVAL_MS).
_data | Pointer to the data to be logged. |
_length | Length of data (in bytes). |
_str | Persistent, raw string. |
#define LOG_HEXDUMP_WRN_RATELIMIT_RATE | ( | _rate_ms, | |
_data, | |||
_length, | |||
_str ) |
#include <zephyr/logging/log.h>
Writes a WARNING level hexdump message to the log with custom rate limiting.
It's meant to register messages related to unusual situations that are not necessarily errors, but with rate limiting to prevent log flooding. The message will be logged at most once per specified interval.
_rate_ms | Minimum interval in milliseconds between log messages. |
_data | Pointer to the data to be logged. |
_length | Length of data (in bytes). |
_str | Persistent, raw string. |
#define LOG_INF | ( | ... | ) |
#include <zephyr/logging/log.h>
Writes an INFO level message to the log.
It's meant to write generic user oriented messages.
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_INF_RATELIMIT | ( | ... | ) |
#include <zephyr/logging/log.h>
Writes an INFO level message to the log with rate limiting.
It's meant to write generic user oriented messages with rate limiting to prevent log flooding. The message will be logged at most once per default interval (see CONFIG_LOG_RATELIMIT_INTERVAL_MS).
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_INF_RATELIMIT_RATE | ( | _rate_ms, | |
... ) |
#include <zephyr/logging/log.h>
Writes an INFO level message to the log with custom rate limiting.
It's meant to write generic user oriented messages with rate limiting to prevent log flooding. The message will be logged at most once per specified interval.
_rate_ms | Minimum interval in milliseconds between log messages. |
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_INST_DBG | ( | _log_inst, | |
... ) |
#include <zephyr/logging/log.h>
Writes a DEBUG level message associated with the instance to the log.
Message is associated with specific instance of the module which has independent filtering settings (if runtime filtering is enabled) and message prefix (<module_name>.<instance_name>). It's meant to write developer oriented information.
_log_inst | Pointer to the log structure associated with the instance. |
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_INST_ERR | ( | _log_inst, | |
... ) |
#include <zephyr/logging/log.h>
Writes an ERROR level message associated with the instance to the log.
Message is associated with specific instance of the module which has independent filtering settings (if runtime filtering is enabled) and message prefix (<module_name>.<instance_name>). It's meant to report severe errors, such as those from which it's not possible to recover.
_log_inst | Pointer to the log structure associated with the instance. |
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_INST_HEXDUMP_DBG | ( | _log_inst, | |
_data, | |||
_length, | |||
_str ) |
#include <zephyr/logging/log.h>
Writes a DEBUG level hexdump message associated with the instance to the log.
It's meant to write developer oriented information.
_log_inst | Pointer to the log structure associated with the instance. |
_data | Pointer to the data to be logged. |
_length | Length of data (in bytes). |
_str | Persistent, raw string. |
#define LOG_INST_HEXDUMP_ERR | ( | _log_inst, | |
_data, | |||
_length, | |||
_str ) |
#include <zephyr/logging/log.h>
Writes an ERROR hexdump message associated with the instance to the log.
Message is associated with specific instance of the module which has independent filtering settings (if runtime filtering is enabled) and message prefix (<module_name>.<instance_name>). It's meant to report severe errors, such as those from which it's not possible to recover.
_log_inst | Pointer to the log structure associated with the instance. |
_data | Pointer to the data to be logged. |
_length | Length of data (in bytes). |
_str | Persistent, raw string. |
#define LOG_INST_HEXDUMP_INF | ( | _log_inst, | |
_data, | |||
_length, | |||
_str ) |
#include <zephyr/logging/log.h>
Writes an INFO level hexdump message associated with the instance to the log.
It's meant to write generic user oriented messages.
_log_inst | Pointer to the log structure associated with the instance. |
_data | Pointer to the data to be logged. |
_length | Length of data (in bytes). |
_str | Persistent, raw string. |
#define LOG_INST_HEXDUMP_WRN | ( | _log_inst, | |
_data, | |||
_length, | |||
_str ) |
#include <zephyr/logging/log.h>
Writes a WARNING level hexdump message associated with the instance to the log.
It's meant to register messages related to unusual situations that are not necessarily errors.
_log_inst | Pointer to the log structure associated with the instance. |
_data | Pointer to the data to be logged. |
_length | Length of data (in bytes). |
_str | Persistent, raw string. |
#define LOG_INST_INF | ( | _log_inst, | |
... ) |
#include <zephyr/logging/log.h>
Writes an INFO level message associated with the instance to the log.
Message is associated with specific instance of the module which has independent filtering settings (if runtime filtering is enabled) and message prefix (<module_name>.<instance_name>). It's meant to write generic user oriented messages.
_log_inst | Pointer to the log structure associated with the instance. |
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_INST_WRN | ( | _log_inst, | |
... ) |
#include <zephyr/logging/log.h>
Writes a WARNING level message associated with the instance to the log.
Message is associated with specific instance of the module which has independent filtering settings (if runtime filtering is enabled) and message prefix (<module_name>.<instance_name>). It's meant to register messages related to unusual situations that are not necessarily errors.
_log_inst | Pointer to the log structure associated with the instance. |
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_LEVEL_SET | ( | level | ) |
#include <zephyr/logging/log.h>
Macro for setting log level in the file or function where instance logging API is used.
level | Level used in file or in function. |
#define LOG_MODULE_DECLARE | ( | ... | ) |
#include <zephyr/logging/log.h>
Macro for declaring a log module (not registering it).
Modules which are split up over multiple files must have exactly one file use LOG_MODULE_REGISTER() to create module-specific state and register the module with the logger core.
The other files in the module should use this macro instead to declare that same state. (Otherwise, LOG_INF() etc. will not be able to refer to module-specific state variables.)
Macro accepts one or two parameters:
Example usage:
#define LOG_MODULE_REGISTER | ( | ... | ) |
#include <zephyr/logging/log.h>
Create module-specific state and register the module with Logger.
This macro normally must be used after including <zephyr/logging/log.h> to complete the initialization of the module.
Module registration can be skipped in two cases:
Macro accepts one or two parameters:
Example usage:
#define LOG_PRINTK | ( | ... | ) |
#include <zephyr/logging/log.h>
Unconditionally print raw log message.
The result is same as if printk was used but it goes through logging infrastructure thus utilizes logging mode, e.g. deferred mode.
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_RAW | ( | ... | ) |
#include <zephyr/logging/log.h>
Unconditionally print raw log message.
Provided string is printed as is without appending any characters (e.g., color or newline).
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_WRN | ( | ... | ) |
#include <zephyr/logging/log.h>
Writes a WARNING level message to the log.
It's meant to register messages related to unusual situations that are not necessarily errors.
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_WRN_ONCE | ( | ... | ) |
#include <zephyr/logging/log.h>
Writes a WARNING level message to the log on the first execution only.
It's meant for situations that warrant investigation but could clutter the logs if output on every execution.
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_WRN_RATELIMIT | ( | ... | ) |
#include <zephyr/logging/log.h>
Writes a WARNING level message to the log with rate limiting.
It's meant for situations that warrant investigation but could clutter the logs if output too frequently. The message will be logged at most once per default interval (see CONFIG_LOG_RATELIMIT_INTERVAL_MS).
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |
#define LOG_WRN_RATELIMIT_RATE | ( | _rate_ms, | |
... ) |
#include <zephyr/logging/log.h>
Writes a WARNING level message to the log with custom rate limiting.
It's meant for situations that warrant investigation but could clutter the logs if output too frequently. The message will be logged at most once per specified interval.
_rate_ms | Minimum interval in milliseconds between log messages. |
... | A string optionally containing printk valid conversion specifier, followed by as many values as specifiers. |