|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Logger API. More...
Files | |
| file | log.h |
| Header file for the logging subsystem. | |
| file | log_core.h |
| Header file for the logging core. | |
| file | log_instance.h |
| Header file for log instance registration. | |
Functions | |
| 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. | |
| static uint32_t | log_dynamic_source_id (const struct log_source_dynamic_data *data) |
| Get index of the log source based on the address of the dynamic data associated with the source. | |
| static uint32_t | log_source_id (const void *source) |
| Get index of the log source based on the address of the associated data. | |
| static void | log_generic (uint8_t level, const char *fmt, va_list ap) |
| Write a generic log message. | |
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. | |
Severity levels | |
| #define | LOG_LEVEL_NONE 0 |
| Severity level used to disable logging for a source. | |
| #define | LOG_LEVEL_ERR 1 |
| Error severity level. | |
| #define | LOG_LEVEL_WRN 2 |
| Warning severity level. | |
| #define | LOG_LEVEL_INF 3 |
| Informational severity level. | |
| #define | LOG_LEVEL_DBG 4 |
| Debug severity level. | |
Instance registration | |
| #define | LOG_OBJECT_PTR_INIT(_name, _object) |
| Initialize pointer to logger instance with explicitly provided object. | |
| #define | LOG_INSTANCE_PTR(_module_name, _inst_name) |
| Get pointer to a logging instance. | |
| #define | LOG_INSTANCE_PTR_INIT(_name, _module_name, _inst_name) |
| Macro for initializing a pointer to the logger instance. | |
| #define | LOG_INSTANCE_PTR_DECLARE(_name) |
| Declare a logger instance pointer in the module structure. | |
| #define | LOG_INSTANCE_REGISTER(_module_name, _inst_name, _level) |
| Macro for registering instance for logging with independent filtering. | |
Logger API.
| #define LOG_DBG | ( | ... | ) |
#include <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 <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 <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 <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 <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 <log.h>
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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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 <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_INSTANCE_PTR | ( | _module_name, | |
| _inst_name ) |
#include <log_instance.h>
Get pointer to a logging instance.
Instance is identified by _module_name and _inst_name.
| _module_name | Module name. |
| _inst_name | Instance name. |
| #define LOG_INSTANCE_PTR_DECLARE | ( | _name | ) |
#include <log_instance.h>
Declare a logger instance pointer in the module structure.
If logging is disabled then element in the structure is still declared to avoid compilation issues. If compiler supports zero length arrays then it is utilized to not use any space, else a byte array is created.
| _name | Name of a structure element that will have a pointer to logging instance object. |
| #define LOG_INSTANCE_PTR_INIT | ( | _name, | |
| _module_name, | |||
| _inst_name ) |
#include <log_instance.h>
Macro for initializing a pointer to the logger instance.
_module_name and _inst_name are concatenated to form a name of the object.
Macro is intended to be used in user structure initializer to initialize a field in the structure that holds pointer to the logging instance. Structure field should be declared using LOG_INSTANCE_PTR_DECLARE.
| _name | Name of a structure element that have a pointer to logging instance object. |
| _module_name | Module name. |
| _inst_name | Instance name. |
| #define LOG_INSTANCE_REGISTER | ( | _module_name, | |
| _inst_name, | |||
| _level ) |
#include <log_instance.h>
Macro for registering instance for logging with independent filtering.
Module instance provides filtering of logs on instance level instead of module level. Instance create using this macro can later on be used with LOG_INSTANCE_PTR_INIT or referenced by LOG_INSTANCE_PTR.
| _module_name | Module name. |
| _inst_name | Instance name. |
| _level | Initial static filtering. |
| #define LOG_LEVEL_DBG 4 |
#include <log_core.h>
Debug severity level.
| #define LOG_LEVEL_ERR 1 |
#include <log_core.h>
Error severity level.
| #define LOG_LEVEL_INF 3 |
#include <log_core.h>
Informational severity level.
| #define LOG_LEVEL_NONE 0 |
#include <log_core.h>
Severity level used to disable logging for a source.
| #define LOG_LEVEL_SET | ( | level | ) |
| #define LOG_LEVEL_WRN 2 |
#include <log_core.h>
Warning severity level.
| #define LOG_MODULE_DECLARE | ( | ... | ) |
#include <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 <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_OBJECT_PTR_INIT | ( | _name, | |
| _object ) |
#include <log_instance.h>
Initialize pointer to logger instance with explicitly provided object.
Macro can be used to initialized a pointer with object that is not unique to the given instance, thus not created with LOG_INSTANCE_REGISTER.
| _name | Name of the structure element for holding logging object. |
| _object | Pointer to a logging instance object. |
| #define LOG_PRINTK | ( | ... | ) |
#include <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_RATELIMIT_INTERVAL_MS 0 |
#include <log.h>
Default interval for rate-limited log messages, in milliseconds.
Period used by the rate-limited logging macros that do not take an explicit rate (for example LOG_ERR_RATELIMIT). It evaluates to
CONFIG_LOG_RATELIMIT_INTERVAL_MS
when
CONFIG_LOG_RATELIMIT
is enabled, and to 0 (no rate limiting) otherwise.
| #define LOG_RAW | ( | ... | ) |
#include <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 <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 <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 <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 <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. |
|
inlinestatic |
#include <log_core.h>
Get index of the log source based on the address of the constant data associated with the source.
| data | Address of the constant data. |
|
inlinestatic |
#include <log_core.h>
Get index of the log source based on the address of the dynamic data associated with the source.
| data | Address of the dynamic data. |
|
inlinestatic |
#include <log_core.h>
Write a generic log message.
| level | Log level. |
| fmt | String to format. |
| ap | Pointer to arguments list. |
|
inlinestatic |
#include <log_core.h>
Get index of the log source based on the address of the associated data.
| source | Address of the data structure (dynamic if runtime filtering is enabled and static otherwise). |