log_output_flush: is it usable with LOG_MODULE_REGISTER and LOG_DBG macros?

Hi there,

In Zephyr 3.6.99 I see a promisive function to make sure that the logging buffer is flushed at a certain moment of time: log_output_flush. It is using a pointer to a structure of type log_output. Question: is that possible to use this function with Zephyr logging functionality available via the macros like LOG_MODULE_REGISTER and further use of LOG_DBG, LOG_INFO, etc? If so, how could be a pointer to that structure be found?

Looking at the zephyr.map file I see that this function is linked, so obviously it should be available somehow, but where is an actual log_output structure instance?! Probably it is hidden somewhere in the wilds of macro substitutions - did anybody had a success to access it log_output structure?

Many thanks for your help in advance!

Parents Reply
  • Hi Runar,

    Thanks for your answer, but my question was about how to access its parameter (const struct log_output *output) from the code that is using LOG_DBG macros (that is not defining log_output structure in that code).

    For example, how would I finalize this snippet:

    #include <zephyr/logging/log.h>
    #include <zephyr/logging/log_output.h>
    LOG_MODULE_REGISTER(main, LOG_LEVEL_DBG);

    int main()

    {

       LOG_DBG("Hello, World!");

       log_output_flush( <what do I specify here?>);

       return 0;

    }

    Thanks again for your help!

Children
No Data
Related