What is the logger message pool? There are two main definitions for it:
- NRF_LOG_MSGPOOL_ELEMENT_COUNT
- NRF_LOG_MSGPOOL_ELEMENT_SIZE
However it is not clear what it is used for?
What is the logger message pool? There are two main definitions for it:
However it is not clear what it is used for?
Hi,
When using deferred logging, the log module uses a memory pool to store logging contents. Those settings set the count (number of entries) and size (number of bytes for each entrry) for that memory pool. They are usually best kept as is, as the default values are chosen to work well with current logging usage patterns in the SDK. In general there is a trade-off between RAM usage (higher for higher values) and performance (better for higher values). See descriptions in the logger module API reference documentation.
Regards,
Terje
What about NRF_LOG_BUFSIZE then? Does it not keep all the logs? I thought that every log is processed and then pushed into this buffer.
Sorry. It seems I had misunderstood how this works.
This is what I recently found out:
Whenever you log something, it is put in a buffer, of size NRF_LOG_BUFSIZE. This is part of the the "log frontend".
Either at a later point (deferred logging) or right away (not deferred logging), the log entry is processed. During processing, the log entry is fetched out of the buffer and provided for the log backend for actually getting sent somewhere as a line of text. This is where the memory pool is used, for sending the log entry from the log frontend to the log backend. NRF_LOG_MSGPOOL_ELEMENT_COUNT and NRF_LOG_MSGPOOL_ELEMENT_SIZE is for configuring the memory pool.
Regards,
Terje
Sorry. It seems I had misunderstood how this works.
This is what I recently found out:
Whenever you log something, it is put in a buffer, of size NRF_LOG_BUFSIZE. This is part of the the "log frontend".
Either at a later point (deferred logging) or right away (not deferred logging), the log entry is processed. During processing, the log entry is fetched out of the buffer and provided for the log backend for actually getting sent somewhere as a line of text. This is where the memory pool is used, for sending the log entry from the log frontend to the log backend. NRF_LOG_MSGPOOL_ELEMENT_COUNT and NRF_LOG_MSGPOOL_ELEMENT_SIZE is for configuring the memory pool.
Regards,
Terje
Thanks! Could you provide a link to a source please?