<?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>Why can the printk function print from the serial port, but log_info can not print out?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/101662/why-can-the-printk-function-print-from-the-serial-port-but-log_info-can-not-print-out</link><description>When I opened the demo project, log_inf could not print in serial port or in RTT, but I changed log_inf to printk and it can print, why, I want to print with log_inf now how to achieve</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Jul 2023 12:02:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/101662/why-can-the-printk-function-print-from-the-serial-port-but-log_info-can-not-print-out" /><item><title>RE: Why can the printk function print from the serial port, but log_info can not print out?</title><link>https://devzone.nordicsemi.com/thread/435481?ContentTypeID=1</link><pubDate>Mon, 10 Jul 2023 12:02:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:502be5b7-17ff-4567-b5da-654040ed47e3</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;For logging in RTT you need to set the following in prj.conf.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_LOG"&gt;CONFIG_LOG=y&lt;br /&gt;&lt;/a&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_USE_SEGGER_RTT"&gt;CONFIG_USE_SEGGER_RTT&lt;/a&gt;=y&lt;br /&gt;&lt;a title="CONFIG_LOG_BACKEND_RTT=y" href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_LOG_BACKEND_RTT"&gt;CONFIG_LOG_BACKEND_RTT=y&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It could also be wise to set the default log level based on what you need.&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_LOG_DEFAULT_LEVEL"&gt;CONFIG_LOG_DEFAULT_LEVEL&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re new to nRF Connect SDK, please go through this course:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/"&gt;academy.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>