<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nrf logging api</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/88168/nrf-logging-api</link><description>hi, 
 sdk 17.1.0 
 Can I call &amp;quot; NRF_LOG_INFO&amp;quot; API back to back ? Does it copy the contents of the buffer (var) to an internal buffer ? 
 For example, in the below code, does the second call &amp;quot;NRF_LOG_INFO&amp;quot; corrupt the buffer &amp;#39;var&amp;#39; ? 
 uint8_t var[31];</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Mon, 23 May 2022 09:35:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/88168/nrf-logging-api" /><item><title>RE: nrf logging api</title><link>https://test-devzone.nordicsemi.com/thread/368961?ContentTypeID=1</link><pubDate>Mon, 23 May 2022 09:35:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9d22bf3-37b6-46d9-bbee-45c282d8625e</guid><dc:creator>user115812</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Thank you for your reply.&lt;/p&gt;
&lt;p&gt;I am calling &amp;quot;NRF_LOG_INFO&amp;quot; from an ISR, and hence my Deferred logging is enabled as given below.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;#define NRF_LOG_DEFERRED 1&lt;/p&gt;
&lt;p&gt;So, I think I should keep extra buffer in my application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf logging api</title><link>https://test-devzone.nordicsemi.com/thread/368925?ContentTypeID=1</link><pubDate>Mon, 23 May 2022 07:54:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80761b86-21f4-4f64-b94f-317b8ae55b48</guid><dc:creator>user7377</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you do not use deferred logging, then this would be OK as logging happens immediately. With deferred logging this will not be OK though, as data&amp;nbsp;is not copied to a dedicated buffer by default. So for volatile data like stack variables or variables that are overwritten (both is the case here), no should explicitly use &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.1.0%2Fgroup__nrf__log.html&amp;amp;anchor=ga5cd6a091973b5f459618ea53c4e47d4e"&gt;NRF_LOG_PUSH&lt;/a&gt;&amp;nbsp;to copy the string to an internal logger buffer. For instance like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_LOG_INFO(&amp;quot;Message: \&amp;quot;%s\&amp;quot;&amp;quot;, NRF_LOG_PUSH(my_volatile_string));&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>