|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Library-private surface of the esp-hosted logging bridge. More...
Go to the source code of this file.
Enumerations | |
| enum | ra8_esp_hosted_log_dump_t : uint8_t { k_ra8_esp_hosted_log_dump_radix = 16U , k_ra8_esp_hosted_log_dump_nibbles = 2U } |
| Constants the hexdump renderer works from. More... | |
Functions | |
| void | priv_ra8_esp_hosted_log_vwrite (int level, const char *tag, const char *fmt, va_list ap) |
| Emit one formatted line from an already-started argument list. | |
| bool | priv_ra8_esp_hosted_log_accepts (int level) |
| Decide whether a line at this level reaches the sink. | |
| int | priv_ra8_esp_hosted_log_level_get (void) |
| Report the current runtime verbosity threshold. | |
Library-private surface of the esp-hosted logging bridge.
The bridge's public face is port/esp-hosted/inc/idf_compat/esp_log.h, which the vendored core includes by name. This header carries the two pieces that are not part of that face: the runtime level decision, which is promoted out of static so its conditions can be driven directly by a host test, and the threshold reader that lets a test observe what esp_log_level_set did without reaching into the module.
Nothing outside port/esp-hosted/ and tests/ may include this.
Definition in file ra8_esp_hosted_log_internal.h.
| enum ra8_esp_hosted_log_dump_t : uint8_t |
Constants the hexdump renderer works from.
Named here rather than left as literals so the dump width and the zero-padding rule are stated once and are visible to the test that checks them.
| Enumerator | |
|---|---|
| k_ra8_esp_hosted_log_dump_radix | Hexadecimal. |
| k_ra8_esp_hosted_log_dump_nibbles | Digits one byte renders as. |
Definition at line 94 of file ra8_esp_hosted_log_internal.h.
|
nodiscard |
Decide whether a line at this level reaches the sink.
Applies the runtime threshold that esp_log_level_set maintains. The compile-time LOG_LOCAL_LEVEL filter has already run at the call site; this is the second, adjustable gate.
| [in] | level | ESP-IDF level of the candidate line. Any integer is accepted, including values outside the enumeration. |
| true | The level is a real level and is at or above the threshold. |
| false | The level is the suppress-everything value, is below the threshold, or is outside the enumeration. |
Decide whether a line at this level reaches the sink.
Definition at line 144 of file ra8_esp_hosted_log.c.
References ESP_LOG_NONE, and s_ra8_esp_hosted_log_level.
Referenced by priv_ra8_esp_hosted_log_vwrite(), and ra8_esp_hosted_log_hexdump().
|
nodiscard |
Report the current runtime verbosity threshold.
Exists so a test can assert what esp_log_level_set stored, including the clamping it applies, without declaring the module's static.
| 0 | Every line is suppressed. |
Report the current runtime verbosity threshold.
Definition at line 233 of file ra8_esp_hosted_log.c.
References s_ra8_esp_hosted_log_level.
| void priv_ra8_esp_hosted_log_vwrite | ( | int | level, |
| const char * | tag, | ||
| const char * | fmt, | ||
| va_list | ap ) |
Emit one formatted line from an already-started argument list.
The body of the logging bridge. ra8_esp_hosted_log_write is a thin varargs face over it, and the vtable's log row is another, so a line emitted through either path is formatted and filtered identically.
| [in] | level | ESP-IDF level of the line. |
| [in] | tag | Tag to attribute the line to; null is replaced with the port's own tag rather than dereferenced. |
| [in] | fmt | Format string; null suppresses the line. |
| [in] | ap | Argument list positioned at the first conversion argument. The caller owns starting and ending it. |
Emit one formatted line from an already-started argument list.
Definition at line 152 of file ra8_esp_hosted_log.c.
References internal_emit(), k_ra8_esp_hosted_log_line_max, priv_ra8_esp_hosted_fmt_vformat(), priv_ra8_esp_hosted_log_accepts(), and s_ra8_esp_hosted_log_tag.
Referenced by internal_printf(), and ra8_esp_hosted_log_write().