BLE logging not showing inf and dbg

Hi,

i am working on the nrf5280, and I have set up BLE with NUS so I have a shell and logging over BLE, as well as logging over UART.

I have a python script running that connects and is able to send shell commands and that works great.  

However, it will only show logs that are WRN or ERR, and doesn't show DBG or INF, but the uart does.

I've tried setting several different kconfig options with no luck


```

bt_nus:~$ logtest all
All log levels printed
[00:00:22.112,884] <wrn> log_test: Test warning message (all levels test)
[00:00:22.112,884] <err> log_test: Test error message (all levels test)`

```

```

[00:00:22.112,854] <dbg> log_test: prv_cmd_log_all: Test debug message (all levels test)
[00:00:22.112,884] <inf> log_test: Test info message (all levels test)
[00:00:22.112,884] <wrn> log_test: Test warning message (all levels test)
[00:00:22.112,884] <err> log_test: Test error message (all levels test)

```

CONFIG_LOG_MAX_LEVEL=4
CONFIG_LOG_DEFAULT_LEVEL=3
Parents
  • Can you add CONFIG_LOG_RUNTIME_FILTERING=y and then at runtime, use this command: "log enable dbg" 

    CONFIG_LOG_MAX_LEVEL=4 and CONFIG_LOG_DEFAULT_LEVEL=3  ensure DBG/INF logs are compiled in, but each backend may still apply its own filter. The UART backend usually prints all level while NUS shell seems to default at ERR/WRN.

    If this doesn't work, try to run "log status" to see the status of your logging modules.


Reply
  • Can you add CONFIG_LOG_RUNTIME_FILTERING=y and then at runtime, use this command: "log enable dbg" 

    CONFIG_LOG_MAX_LEVEL=4 and CONFIG_LOG_DEFAULT_LEVEL=3  ensure DBG/INF logs are compiled in, but each backend may still apply its own filter. The UART backend usually prints all level while NUS shell seems to default at ERR/WRN.

    If this doesn't work, try to run "log status" to see the status of your logging modules.


Children
  • Running "log enable dbg" works, and right now I can have my python script that runs on the PC side automatically send that once it connects, but I'd prefer to have the device set the config. is it possible to do it with kconfigs or programatically?

    I tried doing it programatically similar to how I have changed the log level during runtime for things coming over the uart but it didn't work the same, I'm assuming for the reason you gave earlier.

Related