This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to set current log level

Hi,

  I'm using the CLI and have logging enabled.  The only way I'm able to see my logging output is if I type "log enable info" at the CLI prompt.

  Is there a way to enable this level of output without having to type this in at the CLI prompt everytime?

  My log status output looks like this -

Is there a way to change the entries in the "current" column programmatically without typing at the CLI prompt? 

Thanks...

Brian

Parents
  • Hi,

    In nRF5 SDK, the state of logging through the Command Line Interface (CLI) is connected to the Logger module and its configuration, as well as the configuration of each individual module. The configuration values are found in the sdk_config.h file of the project, with names such as NRF_SDH_LOG_ENABLED and NRF_SDH_LOG_LEVEL.

    Regards,
    Terje

Reply
  • Hi,

    In nRF5 SDK, the state of logging through the Command Line Interface (CLI) is connected to the Logger module and its configuration, as well as the configuration of each individual module. The configuration values are found in the sdk_config.h file of the project, with names such as NRF_SDH_LOG_ENABLED and NRF_SDH_LOG_LEVEL.

    Regards,
    Terje

Children
  • Hi Terje,

      I've added the following defines to sdk_config.h -

    #define APP_CONFIG_LOG_LEVEL                  4
    #define APP_CONFIG_LOG_ENABLED            1
    but still do not get any log output by default.  A "log status" at the CLI shows this for the app module -
    module_name | current | built-in
    ----------------------------------------------------------
    ...
    app                                      | none    | debug
    ...
      How do I get the "current" field of the app module to default to debug without typing "log enable debug" each time I start up my code?
      Thanks...
    Brian
  • Does anyone know how to get log output for a module without typing into the CLI?

    Brian

  • I resolved this issue.  Moved NRF_LOG_INIT to before nrf_cli_init, and it all works now.

    Brian

Related