<?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>Add timestamps to minimal logging</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/115943/add-timestamps-to-minimal-logging</link><description>Hi we are working on a matter project using ncs v2.6.0 
 Currently we are running out of RAM memory and that&amp;#180;s why we have moved to minimal logging by enabling 
 
 
 Now we would like to add timestamps to the logs, but we don&amp;#180;t want to move to deferred</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 31 Oct 2024 19:23:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/115943/add-timestamps-to-minimal-logging" /><item><title>RE: Add timestamps to minimal logging</title><link>https://devzone.nordicsemi.com/thread/508725?ContentTypeID=1</link><pubDate>Thu, 31 Oct 2024 19:23:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f633cdc-c29f-4bd1-a15d-3564cf0e4fea</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Please create a new support for the latest issue which is away from the original scope.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add timestamps to minimal logging</title><link>https://devzone.nordicsemi.com/thread/508589?ContentTypeID=1</link><pubDate>Wed, 30 Oct 2024 19:01:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57fb9b3d-ed4d-42a7-ade9-9d08f9e166a6</guid><dc:creator>Hugo.Dev</dc:creator><description>&lt;p&gt;Ok, I see, as I thought CONFIG_LOG_MODE_MINIMAL excludes timestamps&lt;/p&gt;
&lt;p&gt;Then I tried&amp;nbsp;CONFIG_LOG_BACKEND_SHOW_COLOR=n but it does not make any diff.&lt;/p&gt;
&lt;p&gt;About&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.6.0/page/nrf/test_and_optimize/optimizing/memory.html"&gt;Memory footprint optimization&lt;/a&gt;&amp;nbsp;we have already been there, not much more to optimize.&lt;/p&gt;
&lt;p&gt;I wonder if I can enable the&amp;nbsp;CONFIG_LOG_CUSTOM_HEADER option in order to define a minimal log with timestamps.&lt;br /&gt;But when trying it I cannot make the compiler find my&amp;nbsp;&lt;span&gt;zephyr_custom_log.h file.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I added&amp;nbsp;&lt;code class="c-mrkdwn__code" data-stringify-type="code"&gt;zephyr_include_directories&lt;/code&gt;&amp;nbsp;in our CMakeLists.txt pointing to the directory holding the header file but it still fails to compile&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Any ideas about what I can be missing?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add timestamps to minimal logging</title><link>https://devzone.nordicsemi.com/thread/508562?ContentTypeID=1</link><pubDate>Wed, 30 Oct 2024 15:29:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11e5ca00-18da-4b89-aa04-55bc99ed0d47</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user=""]Is there a way to enable/add timestamps using minimal logging?[/quote]
&lt;p&gt;Are you using&amp;nbsp;&lt;a title="(in Kconfig reference v&amp;amp;nbsp;)" href="https://docs.nordicsemi.com/bundle/ncs-2.6.0/page/kconfig/index.html#CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP"&gt;&lt;code&gt;&lt;span&gt;CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&amp;nbsp;or &lt;a title="(in Kconfig reference v&amp;amp;nbsp;)" href="https://docs.nordicsemi.com/bundle/ncs-2.6.0/page/kconfig/index.html#CONFIG_LOG_TIMESTAMP_64BIT"&gt;&lt;code&gt;&lt;span&gt;CONFIG_LOG_TIMESTAMP_64BIT&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;?&amp;nbsp;If so, see the configs d&lt;span&gt;ependencies&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1730301491527v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1730301698894v2.png" alt=" " /&gt;&lt;/p&gt;
[quote user=""]Is there a way to disable some features of deferred logging to keep it as minimal as possible but logging timestamps?[/quote]
&lt;p&gt;&lt;span&gt;To minimize the memory usage of deferred logging, you can adjust the log level. Setting a higher default log level will reduce the number of log messages compiled into the firmware:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_LOG_DEFAULT_LEVEL=3  # Set to INFO level&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-3-printing-messages-to-console-and-logging/topic/logger-module/" rel="noopener noreferrer" target="_blank"&gt;Logger module&lt;/a&gt;&lt;span&gt;&amp;nbsp;explains that logs can be filtered out based on module and severity level during compilation.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;You can also disable some features that you don&amp;#39;t need, such as coloring:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_LOG_BACKEND_SHOW_COLOR=n&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If the above still cannot help, you might consider disabling some other features or&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.6.0/page/nrf/test_and_optimize/optimizing/memory.html"&gt;Memory footprint optimization&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>