|
oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
|
Compile-time filtered logging macros over the system console. More...
Macros | |
| #define | OVE_LOG_LEVEL OVE_LOG_LEVEL_INF |
| Compile-time log level threshold. | |
| #define | OVE_LOG_ERR(fmt, ...) _OVE_LOG_OUTPUT("[E] ", fmt, ##__VA_ARGS__) |
| Log an error message. | |
| #define | OVE_LOG_WRN(fmt, ...) _OVE_LOG_OUTPUT("[W] ", fmt, ##__VA_ARGS__) |
| Log a warning message. | |
| #define | OVE_LOG_INF(fmt, ...) _OVE_LOG_OUTPUT("[I] ", fmt, ##__VA_ARGS__) |
| Log an informational message. | |
| #define | OVE_LOG_DBG(fmt, ...) _OVE_LOG_OUTPUT("[D] ", fmt, ##__VA_ARGS__) |
| Log a debug message. | |
| #define | _OVE_LOG_RAW(fmt, ...) |
| Internal helper: format and emit a raw (unprefixed) console line. | |
| #define | OVE_LOG(fmt, ...) _OVE_LOG_RAW(fmt, ##__VA_ARGS__) |
| Emit a raw (unprefixed) log message. | |
Compile-time filtered logging macros over the system console.
Provides four severity levels: error, warning, info, and debug. The active level is controlled at compile time by defining OVE_LOG_LEVEL to one of the OVE_LOG_LEVEL_* constants before including this header; messages at levels above the configured threshold expand to no-ops and generate no code.
Each macro formats a message with snprintf into a 256-byte stack buffer and writes it through ove_console_write. A trailing newline is appended automatically.
CONFIG_OVE_CONSOLE. | #define OVE_LOG_LEVEL OVE_LOG_LEVEL_INF |
Compile-time log level threshold.
All log macros with a severity numerically greater than this value expand to no-ops. Defaults to OVE_LOG_LEVEL_INF if not defined externally.
| #define OVE_LOG_ERR | ( | fmt, | |
| ... | |||
| ) | _OVE_LOG_OUTPUT("[E] ", fmt, ##__VA_ARGS__) |
Log an error message.
Emits a "[E] " prefixed, newline-terminated message via the console. Expands to a no-op when OVE_LOG_LEVEL < OVE_LOG_LEVEL_ERR.
| [in] | fmt | printf-style format string. |
| [in] | ... | Format arguments. |
| #define OVE_LOG_WRN | ( | fmt, | |
| ... | |||
| ) | _OVE_LOG_OUTPUT("[W] ", fmt, ##__VA_ARGS__) |
Log a warning message.
Emits a "[W] " prefixed, newline-terminated message via the console. Expands to a no-op when OVE_LOG_LEVEL < OVE_LOG_LEVEL_WRN.
| [in] | fmt | printf-style format string. |
| [in] | ... | Format arguments. |
| #define OVE_LOG_INF | ( | fmt, | |
| ... | |||
| ) | _OVE_LOG_OUTPUT("[I] ", fmt, ##__VA_ARGS__) |
Log an informational message.
Emits a "[I] " prefixed, newline-terminated message via the console. Expands to a no-op when OVE_LOG_LEVEL < OVE_LOG_LEVEL_INF.
| [in] | fmt | printf-style format string. |
| [in] | ... | Format arguments. |
| #define OVE_LOG_DBG | ( | fmt, | |
| ... | |||
| ) | _OVE_LOG_OUTPUT("[D] ", fmt, ##__VA_ARGS__) |
Log a debug message.
Emits a "[D] " prefixed, newline-terminated message via the console. Expands to a no-op when OVE_LOG_LEVEL < OVE_LOG_LEVEL_DBG.
| [in] | fmt | printf-style format string. |
| [in] | ... | Format arguments. |
| #define _OVE_LOG_RAW | ( | fmt, | |
| ... | |||
| ) |
Internal helper: format and emit a raw (unprefixed) console line.
Used by framework internals where the caller controls newlines and prefixes. Output is truncated to 256 bytes.
| [in] | fmt | printf-style format string. |
| [in] | ... | Format arguments. |
| #define OVE_LOG | ( | fmt, | |
| ... | |||
| ) | _OVE_LOG_RAW(fmt, ##__VA_ARGS__) |
Emit a raw (unprefixed) log message.
Writes a formatted string directly to the console without adding any severity prefix or automatic newline. The caller is responsible for including "\\n" in the format string if needed.
| [in] | fmt | printf-style format string. |
| [in] | ... | Format arguments. |