{"id":9388,"date":"2019-03-25T10:22:57","date_gmt":"2019-03-25T10:22:57","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=9388"},"modified":"2019-03-25T10:22:57","modified_gmt":"2019-03-25T10:22:57","slug":"esp-idf-logging","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=9388","title":{"rendered":"ESP-IDF Logging"},"content":{"rendered":"<p><a href=\"https:\/\/docs.espressif.com\/projects\/esp-idf\/en\/latest\/api-reference\/system\/log.html\">Logging library<\/a><br \/>\n<a href=\"https:\/\/docs.espressif.com\/projects\/esp-idf\/en\/latest\/api-guides\/app_trace.html#logging-to-host\">Logging to Host (via JTAG)<\/a><\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nI (352) boot: Loaded app from partition at offset 0x10000\r\nI (352) boot: Disabling RNG early entropy source...\r\nW (101187) BT_RFCOMM: port_rfc_closed RFCOMM connection in state 2 closed: Closed (res: 19)\r\nW (101227) BT_RFCOMM: rfc_find_lcid_mcb LCID reused LCID:0x42 current:0x0\r\nW (101227) BT_RFCOMM: RFCOMM_DisconnectInd LCID:0x42\r\n^     ^      ^\r\n|     |      |\r\n|     |     Tag\r\n| Timestamp\r\nLetter (E = Error, W = Warning, D = Debug, V = Verbose, I = Information)\r\n\r\n#define LOG_FORMAT(letter, format)  LOG_COLOR_ ## letter #letter &quot; (%d) %s: &quot; format LOG_RESET_COLOR &quot;\\n&quot;\r\n\r\nesp_log_write(ESP_LOG_ERROR,      tag, LOG_FORMAT(E, format), esp_log_timestamp(), tag, ##__VA_ARGS__);\r\n\r\n\/**\r\n * @brief Function which returns timestamp to be used in log output\r\n *\r\n * This function is used in expansion of ESP_LOGx macros.\r\n * In the 2nd stage bootloader, and at early application startup stage\r\n * this function uses CPU cycle counter as time source. Later when\r\n * FreeRTOS scheduler start running, it switches to FreeRTOS tick count.\r\n *\r\n * For now, we ignore millisecond counter overflow.\r\n *\r\n * @return timestamp, in milliseconds\r\n *\/\r\nuint32_t esp_log_timestamp(void);\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Logging library Logging to Host (via JTAG) I (352) boot: Loaded app from partition at offset 0x10000 I (352) boot: Disabling RNG early entropy source&#8230; W (101187) BT_RFCOMM: port_rfc_closed RFCOMM connection in state 2 closed: Closed (res: 19) W (101227) BT_RFCOMM: rfc_find_lcid_mcb LCID reused LCID:0x42 current:0x0 W (101227) BT_RFCOMM: RFCOMM_DisconnectInd LCID:0x42 ^ ^ ^ | [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9388","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/9388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9388"}],"version-history":[{"count":1,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/9388\/revisions"}],"predecessor-version":[{"id":9389,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/9388\/revisions\/9389"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}