Conversation
👋 Hello erhankur, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
There was a problem hiding this comment.
Pull request overview
This PR adds runtime-configurable log level control to esp-stub-lib, allowing applications to adjust verbosity dynamically through both the build configuration (STUB_LIB_LOG_LEVEL) and runtime API calls.
Changes:
- Introduces a new
stub_lib_log_level_tenum with levels from NONE to VERBOSE (V) - Adds runtime log level management through new public API functions
- Refactors logging macros to support conditional logging based on runtime level
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| include/esp-stub-lib/log.h | Adds log level enum type, new public API functions for log level control, and refactors logging macros to check runtime level |
| src/log_common.c | Implements log level management with normalization, getter, and setter functions |
| src/log_uart.c | Renames stub_lib_log_init() to stub_lib_log_backend_init() to separate backend initialization from level configuration |
| src/log_buf.c | Renames stub_lib_log_init() to stub_lib_log_backend_init() for consistency with log_uart.c |
| example/stub_main.c | Demonstrates the new API by passing initial log level to STUB_LOG_INIT and changing level at runtime |
08118ef to
6df67f1
Compare
|
LGTM, thanks, nice improvement.Just out of curiosity, you need to be able to change log verbosity during runtime? Just so you know, I plan to implement possibility to set output channel for logging (UART0,1, USB-Serial-JTAG), which will be really useful for us. So we might need to add new parameter to the |
We need different log levels. Some logs are verbose and not critical to see all the time. However, when needed, we should be able to increase the log level from OpenOCD without rebuilding the stub code.
Will be a nice improvement. |
|
@Dzarda7 Thank you for the quick review. |
This PR adds configurable log-level control for esp-stub-lib from both application code and build configuration.