<?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>Zephyr shell &amp;amp; log timestamp format</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92355/zephyr-shell-log-timestamp-format</link><description>Hi All, How do I get the raw timestamp in the shell out ? I did try several log timestamp settings but no success. 
 Observer behavior: *** Booting Zephyr OS build v3.0.99-ncs1-1 *** [00:00:00.252,929] &amp;lt;inf&amp;gt; app_event_manager: e:module_state_event module</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Oct 2022 08:21:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92355/zephyr-shell-log-timestamp-format" /><item><title>RE: Zephyr shell &amp; log timestamp format</title><link>https://devzone.nordicsemi.com/thread/388911?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2022 08:21:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b24bae6-8553-422c-b26f-eadc20cc5368</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;It doesn&amp;#39;t matter that&amp;nbsp;CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n is set in proj.conf if you cannot see it in the .config file.&lt;/p&gt;
&lt;p&gt;The .config file is the result of your different configurations, so if&amp;nbsp;CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n doesn&amp;#39;t show up there, then another option is overwriting it.&lt;/p&gt;
&lt;p&gt;-Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr shell &amp; log timestamp format</title><link>https://devzone.nordicsemi.com/thread/388871?ContentTypeID=1</link><pubDate>Sun, 02 Oct 2022 06:12:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae1b7584-ef91-4a69-be40-b45665dd12d4</guid><dc:creator>nRF5xFanboy</dc:creator><description>&lt;p&gt;Hi Einarh&lt;br /&gt;&lt;br /&gt;I do confirm&amp;nbsp;&lt;span&gt;the flag is&amp;nbsp;in proj.conf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;I have three hardware platforms / build folders to check.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In two builds (I&amp;nbsp;most often used for development) &lt;/span&gt;&lt;span&gt;the flag is&amp;nbsp;in absent&amp;nbsp;build_x/zephyr/.config?&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;The third build was not&amp;nbsp;create with ncs&amp;nbsp;2.0.2&amp;nbsp;so not wise to&amp;nbsp;&lt;/span&gt;&lt;span&gt;compare.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;best regards,&lt;br /&gt;&amp;nbsp; &amp;nbsp;nRF5xFanBoy&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr shell &amp; log timestamp format</title><link>https://devzone.nordicsemi.com/thread/388166?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2022 13:54:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87ac549a-379f-4b5c-ba92-067b4786564e</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Did you try setting &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/logging/index.html#global-kconfig-options"&gt;CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n&lt;/a&gt;&amp;nbsp;?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;
&lt;p&gt;edit:&lt;/p&gt;
&lt;p&gt;wait, I&amp;#39;m blind, you already set that.&lt;/p&gt;
&lt;p&gt;Can you confirm that this flag is actually set by checking build/zephyr/.config?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr shell &amp; log timestamp format</title><link>https://devzone.nordicsemi.com/thread/388111?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2022 11:18:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44ece011-4cf7-4d98-8556-1bdb74130c22</guid><dc:creator>nRF5xFanboy</dc:creator><description>&lt;p&gt;I did dive into some of the zephyr source code for logging in the shell and the backends and I got confused:&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Log_backend_native_posix.c&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
static void put(const struct log_backend *const backend,
		struct log_msg *msg)
{
	log_msg_get(msg);

	uint32_t flags = LOG_OUTPUT_FLAG_LEVEL | LOG_OUTPUT_FLAG_TIMESTAMP;   /// &amp;lt;--  ????

	if (IS_ENABLED(CONFIG_LOG_BACKEND_SHOW_COLOR)) {
		if (posix_trace_over_tty(0)) {
			flags |= LOG_OUTPUT_FLAG_COLORS;
		}
	}

	if (IS_ENABLED(CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP)) {
		flags |= LOG_OUTPUT_FLAG_FORMAT_TIMESTAMP;   	/// &amp;lt;--  ???? why ??
	}

	log_output_msg_process(&amp;amp;log_output_posix, msg, flags);

	log_msg_put(msg);

}
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;shell_log_backend.c&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
static void msg_process(const struct log_output *log_output,
			struct log_msg *msg, bool colors)
{
	uint32_t flags = LOG_OUTPUT_FLAG_LEVEL |
		      LOG_OUTPUT_FLAG_TIMESTAMP |
		      LOG_OUTPUT_FLAG_FORMAT_TIMESTAMP;

	if (colors) {
		flags |= LOG_OUTPUT_FLAG_COLORS;
	}

	log_output_msg_process(log_output, msg, flags);
	log_msg_put(msg);
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;log_core.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
static int timestamp_print(const struct log_output *output,
			   uint32_t flags, log_timestamp_t timestamp)
{
	int length;
	bool format =
		(flags &amp;amp; LOG_OUTPUT_FLAG_FORMAT_TIMESTAMP) |   /// &amp;lt;--- always true
		(flags &amp;amp; LOG_OUTPUT_FLAG_FORMAT_SYSLOG) |
		IS_ENABLED(CONFIG_LOG_OUTPUT_FORMAT_LINUX_TIMESTAMP); /// ?????

...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Based upon above statements it seems&amp;nbsp;shell logging can never become raw &lt;br /&gt;Question to Zephyr is&amp;nbsp;that intended by design or a bug?&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>