<?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>Turn on NRF LOGGING to a certain level in one module only?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84841/turn-on-nrf-logging-to-a-certain-level-in-one-module-only</link><description>How can I turn on DEBUG level logs in only this one module without turning on the whole system. 
 
 
 
 Thanks</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Feb 2022 07:20:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84841/turn-on-nrf-logging-to-a-certain-level-in-one-module-only" /><item><title>RE: Turn on NRF LOGGING to a certain level in one module only?</title><link>https://devzone.nordicsemi.com/thread/353512?ContentTypeID=1</link><pubDate>Thu, 17 Feb 2022 07:20:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd8bb469-b045-4fec-8303-d6996b9aa48c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Reading your question again, perhaps you want to see logs from other modules as well, but only debug from one module. Either way, you need to manually set the other log levels to not include debug, but NRF_LOG_DEFAULT_LEVEL needs to be set to 4, and so does the log level for the module that you want to see.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turn on NRF LOGGING to a certain level in one module only?</title><link>https://devzone.nordicsemi.com/thread/353510?ContentTypeID=1</link><pubDate>Thu, 17 Feb 2022 07:18:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa6ede32-9c14-4694-8e47-49494263b3db</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;That is not possible, I am afraid. If you look at the definition for NRF_LOG_INTERNAL_MODULE:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define NRF_LOG_INTERNAL_MODULE(level, level_id, ...)                                    \
    if (NRF_LOG_ENABLED &amp;amp;&amp;amp; (NRF_LOG_LEVEL &amp;gt;= level) &amp;amp;&amp;amp;                                   \
        (level &amp;lt;= NRF_LOG_DEFAULT_LEVEL))                                                \
    {                                                                                    \
        if (NRF_LOG_FILTER &amp;gt;= level)                                                     \
        {                                                                                \
            LOG_INTERNAL(LOG_SEVERITY_MOD_ID(level_id), __VA_ARGS__);                    \
        }                                                                                \
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can see that it is printed if:&lt;/p&gt;
&lt;p&gt;1: NRF_LOG_ENABLED (so you need to enable logging in general,&lt;/p&gt;
&lt;p&gt;2: NRF_LOG_LEVEL &amp;gt;= level, where NRF_LOG_LEVEL is the module log level set in sdk_config.h (e.g.&amp;nbsp;NRF_PWR_MGMT_CONFIG_LOG_LEVEL), and,&lt;/p&gt;
&lt;p&gt;3:&amp;nbsp;level &amp;lt;= NRF_LOG_DEFAULT_LEVEL, that is, the level you are printing (NRF_LOG_DEBUG()) is at least&amp;nbsp;&lt;span&gt;NRF_LOG_DEFAULT_LEVEL (from sdk_config.h).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So if you want to print only from debug from one module, you need to enable logging in general (NRF_LOG_ENABLED = 1), and you need to disable the other modules that are printing from sdk_config.h, and you need to set the log level for that module to &amp;quot;debug&amp;quot; (=4).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edvin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>