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
  • Hi, sorry you are correct, those would just enable logs from the BT modules.
    Unfortunately, I can't find any built in Kconfig that would enable this. So, your best bet is to do this in app if you don't want to let the python script handle it.

    I suggest taking a look at your \zephyr\include\zephyr\shell folder 

    I haven't tested this yet but something like this might work.

    #include <zephyr/shell/shell_backend.h>
    #include <zephyr/shell/shell.h>
    
    static int raise_all_shells_to_dbg(void)
    {
        int n = shell_backend_count_get();
        for (int i = 0; i < n; ++i) {
            const struct shell *sh = shell_backend_get(i);
            if (sh) {
                shell_execute_cmd(sh, "log enable dbg");
            }
        }
        return 0;
    }
    
    


    Let me know if you succeed

  • Thanks

    For now I have decided to just send the command from the python app automatically when it first connects

Reply Children
No Data
Related