<?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>Not possible to disable the shell as a log backend in Zephyr (for nRF9160)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57906/not-possible-to-disable-the-shell-as-a-log-backend-in-zephyr-for-nrf9160</link><description>Hi, 
 We are using nRF Connect SDK 1.1 for nRF9160. 
 It is not possible to turn off the shell as a log backend in Zephyr. Is this a bug or a feature? Is there any way I can disable it? 
 How to reproduce: 
 1) I set the symbol CONFIG_SHELL_LOG_BACKEND</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 20 Feb 2020 07:46:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57906/not-possible-to-disable-the-shell-as-a-log-backend-in-zephyr-for-nrf9160" /><item><title>RE: Not possible to disable the shell as a log backend in Zephyr (for nRF9160)</title><link>https://devzone.nordicsemi.com/thread/235326?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 07:46:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfd8858e-366b-4af1-9239-13607a732b65</guid><dc:creator>Bjorn191023</dc:creator><description>[quote userid="82276" url="~/f/nordic-q-a/57906/not-possible-to-disable-the-shell-as-a-log-backend-in-zephyr-for-nrf9160/234870"]You can do that by setting SHELL_BACKEND_SERIAL_LOG_LEVEL_NONE, which will initialize shell as log backend but with logs disabled for that backend.&amp;nbsp;[/quote]
&lt;p&gt;I can confirm this works, thanks for the help :-)&lt;/p&gt;
&lt;p&gt;I still think it is a bit strange, the obvious thing is to disable the shell as a logger backend thru&amp;nbsp;&lt;span&gt;SHELL_LOG_BACKEND=n.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;BR / Bj&amp;ouml;rn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not possible to disable the shell as a log backend in Zephyr (for nRF9160)</title><link>https://devzone.nordicsemi.com/thread/235318?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 06:37:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f949ff4a-1ca9-44d0-944e-a6184527bd16</guid><dc:creator>Bjorn191023</dc:creator><description>&lt;p&gt;Thanks Heidi, I will try this.&lt;/p&gt;
&lt;p&gt;BR / Bj&amp;ouml;rn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not possible to disable the shell as a log backend in Zephyr (for nRF9160)</title><link>https://devzone.nordicsemi.com/thread/234870?ContentTypeID=1</link><pubDate>Tue, 18 Feb 2020 11:24:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e6fd31a-bffd-429e-bfd0-65b7fa8ae7c1</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi Björn,&lt;/p&gt;
&lt;p&gt;You can do that by setting SHELL_BACKEND_SERIAL_LOG_LEVEL_NONE, which will initialize shell as log backend but with logs disabled for that backend.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not possible to disable the shell as a log backend in Zephyr (for nRF9160)</title><link>https://devzone.nordicsemi.com/thread/234691?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2020 14:45:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6135960f-5a32-4ea9-a9c5-21459c255f7b</guid><dc:creator>Bjorn191023</dc:creator><description>&lt;p&gt;Yes, when disabling the Shell altogether it is not used as a logger backend. However, we need the Shell in our application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think this a very common combination - an app that needs both logging and a shell. It&amp;#39;s too bad it isn&amp;#39;t possible to enable the Shell without using it as a logger backend.&lt;/p&gt;
&lt;p&gt;Anyway, thanks for you feedback.&lt;/p&gt;
&lt;p&gt;BR / Bj&amp;ouml;rn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not possible to disable the shell as a log backend in Zephyr (for nRF9160)</title><link>https://devzone.nordicsemi.com/thread/234688?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2020 14:41:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07730dde-875d-468a-8319-e15823e21a87</guid><dc:creator>MJD093</dc:creator><description>&lt;p&gt;Have you tried just turning the shell off with CONFIG_SHELL=n?&lt;/p&gt;
&lt;p&gt;The shell log depends on SHELL being true so if you have the shell enabled and logging on, it will enable the shell backend&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not possible to disable the shell as a log backend in Zephyr (for nRF9160)</title><link>https://devzone.nordicsemi.com/thread/234686?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2020 14:39:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5410c1fa-24c6-4de3-bb3c-0a23ef0b88f3</guid><dc:creator>Bjorn191023</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;On the other hand the documentation of the Shell (&lt;a href="https://docs.zephyrproject.org/latest/reference/shell/index.html"&gt;https://docs.zephyrproject.org/latest/reference/shell/index.html&lt;/a&gt;) indicates (according to my interpretation) that using the Shell as a logger backend is optional:&lt;/p&gt;
&lt;h2&gt;&lt;a class="toc-backref" href="https://docs.zephyrproject.org/latest/reference/shell/index.html#id11"&gt;Shell as the logger backend&lt;/a&gt;&lt;a class="headerlink" title="Permalink to this headline" href="https://docs.zephyrproject.org/latest/reference/shell/index.html#shell-as-the-logger-backend"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Shell instance can act as the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a class="reference internal" href="https://docs.zephyrproject.org/latest/reference/logging/index.html#logger"&gt;&lt;span class="std std-ref"&gt;Logging&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;backend. Shell ensures that log messages are correctly multiplexed with shell output. Log messages from logger thread are enqueued and processed in the shell thread. Logger thread will block for configurable amount of time if queue is full, blocking logger thread context for that time. Oldest log message is removed from the queue after timeout and new message is enqueued. Use the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;shell&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="pre"&gt;stats&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="pre"&gt;show&lt;/span&gt;&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;command to retrieve number of log messages dropped by the shell instance. Log queue size and timeout are&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a class="reference internal" title="SHELL_DEFINE" href="https://docs.zephyrproject.org/latest/reference/shell/index.html#c.SHELL_DEFINE"&gt;&lt;code class="xref c c-macro docutils literal notranslate"&gt;&lt;span class="pre"&gt;SHELL_DEFINE&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;arguments.&lt;/p&gt;
&lt;div class="admonition warning"&gt;
&lt;p class="admonition-title"&gt;Warning&lt;/p&gt;
&lt;p&gt;Enqueuing timeout must be set carefully when multiple backends are used in the system. The shell instance could have a slow transport or could block, for example, by a UART with hardware flow control. If timeout is set too high, the logger thread could be blocked and impact other logger backends.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="admonition warning"&gt;
&lt;p class="admonition-title"&gt;Warning&lt;/p&gt;
&lt;p&gt;As the shell is a complex logger backend, it can not output logs if the application crashes before the shell thread is running. In this situation, you can enable one of the simple logging backends instead, such as UART (&lt;a class="reference internal" href="https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_LOG_BACKEND_UART.html#cmdoption-arg-config-log-backend-uart"&gt;&lt;code class="xref std std-option docutils literal notranslate"&gt;&lt;span class="pre"&gt;CONFIG_LOG_BACKEND_UART&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;) or RTT (&lt;a class="reference internal" href="https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_LOG_BACKEND_RTT.html#cmdoption-arg-config-log-backend-rtt"&gt;&lt;code class="xref std std-option docutils literal notranslate"&gt;&lt;span class="pre"&gt;CONFIG_LOG_BACKEND_RTT&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;), which are available earlier during system initialization.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;I cant understand why it should not be possible to disable the Sell as a backend?&lt;/p&gt;
&lt;p&gt;BR / Bj&amp;ouml;rn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not possible to disable the shell as a log backend in Zephyr (for nRF9160)</title><link>https://devzone.nordicsemi.com/thread/234681?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2020 14:33:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:645acd3a-acbb-4946-9bae-9db9b4b4a142</guid><dc:creator>MJD093</dc:creator><description>&lt;p&gt;Right ok, well as per the Zephyr documentation, LOG and SHELL_LOG_BACKEND go hand in hand. &lt;/p&gt;
&lt;p&gt;SHELL_LOG_BACKEND is not a user definable symbol and is called indirectly by LOG, you can&amp;#39;t have one without the other according to the Zephyr documentation. This would appear not to be a bug but how the actual feature works as they have specified this linkage in the Zephyr Project documentation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not possible to disable the shell as a log backend in Zephyr (for nRF9160)</title><link>https://devzone.nordicsemi.com/thread/234680?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2020 14:31:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b24f1e31-adfe-4ad5-bffb-18ca797277aa</guid><dc:creator>Bjorn191023</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You misunderstand. Clarification:&lt;/p&gt;
&lt;p&gt;1) I have enabled logs thorugh CONFIG_LOG=y, and I want to have logs enabled.&lt;/p&gt;
&lt;p&gt;2) I DONT want to use the shell as a logger backend, I want to turn it off through the setting SHELL_LOG_BACKEND=n, but it does not seem to be possible according to the info I have given.&lt;/p&gt;
&lt;p&gt;3) I want to use the UART as a logger backend instead through&amp;nbsp;CONFIG_LOG_BACKEND_UART=y.&lt;/p&gt;
&lt;p&gt;My question is: Why is it not possible to disable&amp;nbsp;&lt;span&gt;the shell as a logger backend? Is this a bug or by design? I also want to know if it possible to disable it some other way!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;BR / Bj&amp;ouml;rn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not possible to disable the shell as a log backend in Zephyr (for nRF9160)</title><link>https://devzone.nordicsemi.com/thread/234678?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2020 14:25:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8d4a04d-0018-4414-ac9f-f1bc70df8754</guid><dc:creator>MJD093</dc:creator><description>&lt;p&gt;According to the &lt;a href="https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_SHELL_LOG_BACKEND.html?highlight=config_shell_log_backend#cmdoption-arg-config-shell-log-backend"&gt;Zephyr manual&lt;/a&gt; for that config option, it defaults to yes if CONFIG_LOG is true.&lt;/p&gt;
&lt;p&gt;Have you checked to see if the CONFIG_LOG is being set true by something else if you haven&amp;#39;t already set CONFIG_LOG=n?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>