<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://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>Disable all printf at a time</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/109659/disable-all-printf-at-a-time</link><description>Hi i am using nrf52840 latest sdk and i need to disable all printf at a single how can i achieve it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 Feb 2026 06:50:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/109659/disable-all-printf-at-a-time" /><item><title>RE: Disable all printf at a time</title><link>https://devzone.nordicsemi.com/thread/562113?ContentTypeID=1</link><pubDate>Thu, 26 Feb 2026 06:50:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13fcadad-d3a5-44f8-9072-c6036f58a91e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Another option can be to wrap the printf calls with a macro like the NRF_LOG_* macros.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#ifdef ENABLE_PRINTF
    #define DEBUG_PRINTF(...) printf(__VA_ARGS__)
#else
    #define DEBUG_PRINTF(...)
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then replace all the printf() calls with&amp;nbsp;&lt;span&gt;DEBUG_PRINTF() using search&amp;amp;replace in your code editor.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disable all printf at a time</title><link>https://devzone.nordicsemi.com/thread/562093?ContentTypeID=1</link><pubDate>Wed, 25 Feb 2026 19:20:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4753068-f7fd-4471-9a60-48897a57a650</guid><dc:creator>araucaria</dc:creator><description>&lt;p&gt;I have the same question: How can I disable all printf() output easily without having to comment out each one of over 300 lines?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disable all printf at a time</title><link>https://devzone.nordicsemi.com/thread/476120?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2024 11:27:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9571bcf-e5d5-48d6-bfb8-3d4a1e8291bb</guid><dc:creator>AP1</dc:creator><description>&lt;p&gt;Hi thanks for reply actually i have more print statements so i wanted to disable print&amp;nbsp; all at a time is there any other method&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disable all printf at a time</title><link>https://devzone.nordicsemi.com/thread/475866?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 10:33:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9452cef7-6010-4fe9-b5c6-dd188eed2151</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;&lt;span style="font-family:inherit;"&gt;The simplest solution is likely to make your &amp;#39;printf&amp;#39; calls conditional.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;E.g.,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define PRINTF_ENABLED 1 

#if PRINTF_ENABLED
    printf(&amp;quot;hello world&amp;quot;);
#endif // PRINTF_ENABLED&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disable all printf at a time</title><link>https://devzone.nordicsemi.com/thread/475808?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 06:47:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e31d1c92-59eb-4000-b4ee-23bc472b55fe</guid><dc:creator>AP1</dc:creator><description>&lt;p&gt;i dont want to print this statement on console&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disable all printf at a time</title><link>https://devzone.nordicsemi.com/thread/475807?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 06:46:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66ddb51e-7fe2-4d20-a7ff-1ae5cb404c8a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;What do you mean by &amp;quot;disable printf all at a time&amp;quot;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disable all printf at a time</title><link>https://devzone.nordicsemi.com/thread/475806?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 06:45:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88e6dc8b-efb6-49cc-96cd-4bc865f62d4a</guid><dc:creator>AP1</dc:creator><description>&lt;p&gt;Hi i am using nrf52840 app ble_central_app_uart&amp;nbsp; latest ver. for this one i need to disable printf all at a time&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disable all printf at a time</title><link>https://devzone.nordicsemi.com/thread/475805?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 06:42:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e771fc14-6c02-4b2b-bcec-3900d2652885</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry, but I&amp;#39;m not sure I understand your question. Could you please try to rephrase it? Also, could you let me know which SDK your project is based on?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>