Using the Zephyr logging system, setting Kconfig option in prj.conf to override logging to level 4 (output LOG_DBG messages) breaks the console and no output is sent at all.
CONFIG_LOG_OVERRIDE_LEVEL=4
CONFIG_GPIO=y CONFIG_LOG=y CONFIG_LOG_PRINTK=y CONFIG_LOG_MODE_DEFERRED=y CONFIG_LOG_BUFFER_SIZE=2048 CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD=0 CONFIG_LOG_DEFAULT_LEVEL=2 CONFIG_LOG_OVERRIDE_LEVEL=3
...
#include <zephyr/logging/log.h>
...
LOG_MODULE_REGISTER(Blinky, CONFIG_LOG_DEFAULT_LEVEL);
...
void main(void)
{
...
while (1) {
ret = gpio_pin_toggle_dt(&led);
if (ret < 0) {
return;
}
ret = gpio_pin_get_dt(&led);
if (ret) {
LOG_INF("LED is on"); // shows up with override level 3 & 4
} else {
LOG_DBG("LED is off"); // shows up with override level 4
}
k_msleep(SLEEP_TIME_MS);
}
}[00:00:00.340,484] <inf> Blinky: LED is on
[00:00:01.340,606] <inf> Blinky: LED is on