esp_log.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef __ESP_LOG_H__
  7. #define __ESP_LOG_H__
  8. #include <stdint.h>
  9. #include <stdarg.h>
  10. #include "sdkconfig.h"
  11. #if !defined(CONFIG_IDF_TARGET_LINUX)
  12. #include "esp_rom_sys.h"
  13. #endif // !CONFIG_IDF_TARGET_LINUX
  14. #if CONFIG_IDF_TARGET_ESP32
  15. #include "esp32/rom/ets_sys.h" // will be removed in idf v5.0
  16. #elif CONFIG_IDF_TARGET_ESP32S2
  17. #include "esp32s2/rom/ets_sys.h"
  18. #elif CONFIG_IDF_TARGET_ESP32S3
  19. #include "esp32s3/rom/ets_sys.h"
  20. #elif CONFIG_IDF_TARGET_ESP32C3
  21. #include "esp32c3/rom/ets_sys.h"
  22. #endif
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /**
  27. * @brief Log level
  28. *
  29. */
  30. typedef enum {
  31. ESP_LOG_NONE, /*!< No log output */
  32. ESP_LOG_ERROR, /*!< Critical errors, software module can not recover on its own */
  33. ESP_LOG_WARN, /*!< Error conditions from which recovery measures have been taken */
  34. ESP_LOG_INFO, /*!< Information messages which describe normal flow of events */
  35. ESP_LOG_DEBUG, /*!< Extra information which is not necessary for normal use (values, pointers, sizes, etc). */
  36. ESP_LOG_VERBOSE /*!< Bigger chunks of debugging information, or frequent messages which can potentially flood the output. */
  37. } esp_log_level_t;
  38. typedef int (*vprintf_like_t)(const char *, va_list);
  39. /**
  40. * @brief Default log level
  41. *
  42. * This is used by the definition of ESP_EARLY_LOGx macros. It is not
  43. * recommended to set this directly, call esp_log_level_set("*", level)
  44. * instead.
  45. */
  46. extern esp_log_level_t esp_log_default_level;
  47. /**
  48. * @brief Set log level for given tag
  49. *
  50. * If logging for given component has already been enabled, changes previous setting.
  51. *
  52. * Note that this function can not raise log level above the level set using
  53. * CONFIG_LOG_MAXIMUM_LEVEL setting in menuconfig.
  54. *
  55. * To raise log level above the default one for a given file, define
  56. * LOG_LOCAL_LEVEL to one of the ESP_LOG_* values, before including
  57. * esp_log.h in this file.
  58. *
  59. * @param tag Tag of the log entries to enable. Must be a non-NULL zero terminated string.
  60. * Value "*" resets log level for all tags to the given value.
  61. *
  62. * @param level Selects log level to enable. Only logs at this and lower verbosity
  63. * levels will be shown.
  64. */
  65. void esp_log_level_set(const char* tag, esp_log_level_t level);
  66. /**
  67. * @brief Set function used to output log entries
  68. *
  69. * By default, log output goes to UART0. This function can be used to redirect log
  70. * output to some other destination, such as file or network. Returns the original
  71. * log handler, which may be necessary to return output to the previous destination.
  72. *
  73. * @param func new Function used for output. Must have same signature as vprintf.
  74. *
  75. * @return func old Function used for output.
  76. */
  77. vprintf_like_t esp_log_set_vprintf(vprintf_like_t func);
  78. /**
  79. * @brief Function which returns timestamp to be used in log output
  80. *
  81. * This function is used in expansion of ESP_LOGx macros.
  82. * In the 2nd stage bootloader, and at early application startup stage
  83. * this function uses CPU cycle counter as time source. Later when
  84. * FreeRTOS scheduler start running, it switches to FreeRTOS tick count.
  85. *
  86. * For now, we ignore millisecond counter overflow.
  87. *
  88. * @return timestamp, in milliseconds
  89. */
  90. uint32_t esp_log_timestamp(void);
  91. /**
  92. * @brief Function which returns system timestamp to be used in log output
  93. *
  94. * This function is used in expansion of ESP_LOGx macros to print
  95. * the system time as "HH:MM:SS.sss". The system time is initialized to
  96. * 0 on startup, this can be set to the correct time with an SNTP sync,
  97. * or manually with standard POSIX time functions.
  98. *
  99. * Currently this will not get used in logging from binary blobs
  100. * (i.e WiFi & Bluetooth libraries), these will still print the RTOS tick time.
  101. *
  102. * @return timestamp, in "HH:MM:SS.sss"
  103. */
  104. char* esp_log_system_timestamp(void);
  105. /**
  106. * @brief Function which returns timestamp to be used in log output
  107. *
  108. * This function uses HW cycle counter and does not depend on OS,
  109. * so it can be safely used after application crash.
  110. *
  111. * @return timestamp, in milliseconds
  112. */
  113. uint32_t esp_log_early_timestamp(void);
  114. /**
  115. * @brief Write message into the log
  116. *
  117. * This function is not intended to be used directly. Instead, use one of
  118. * ESP_LOGE, ESP_LOGW, ESP_LOGI, ESP_LOGD, ESP_LOGV macros.
  119. *
  120. * This function or these macros should not be used from an interrupt.
  121. */
  122. void esp_log_write(esp_log_level_t level, const char* tag, const char* format, ...) __attribute__ ((format (printf, 3, 4)));
  123. /**
  124. * @brief Write message into the log, va_list variant
  125. * @see esp_log_write()
  126. *
  127. * This function is provided to ease integration toward other logging framework,
  128. * so that esp_log can be used as a log sink.
  129. */
  130. void esp_log_writev(esp_log_level_t level, const char* tag, const char* format, va_list args);
  131. /** @cond */
  132. #include "esp_log_internal.h"
  133. #ifndef LOG_LOCAL_LEVEL
  134. #ifndef BOOTLOADER_BUILD
  135. #define LOG_LOCAL_LEVEL CONFIG_LOG_MAXIMUM_LEVEL
  136. #else
  137. #define LOG_LOCAL_LEVEL CONFIG_BOOTLOADER_LOG_LEVEL
  138. #endif
  139. #endif
  140. /** @endcond */
  141. /**
  142. * @brief Log a buffer of hex bytes at specified level, separated into 16 bytes each line.
  143. *
  144. * @param tag description tag
  145. * @param buffer Pointer to the buffer array
  146. * @param buff_len length of buffer in bytes
  147. * @param level level of the log
  148. *
  149. */
  150. #define ESP_LOG_BUFFER_HEX_LEVEL( tag, buffer, buff_len, level ) \
  151. do {\
  152. if ( LOG_LOCAL_LEVEL >= (level) ) { \
  153. esp_log_buffer_hex_internal( tag, buffer, buff_len, level ); \
  154. } \
  155. } while(0)
  156. /**
  157. * @brief Log a buffer of characters at specified level, separated into 16 bytes each line. Buffer should contain only printable characters.
  158. *
  159. * @param tag description tag
  160. * @param buffer Pointer to the buffer array
  161. * @param buff_len length of buffer in bytes
  162. * @param level level of the log
  163. *
  164. */
  165. #define ESP_LOG_BUFFER_CHAR_LEVEL( tag, buffer, buff_len, level ) \
  166. do {\
  167. if ( LOG_LOCAL_LEVEL >= (level) ) { \
  168. esp_log_buffer_char_internal( tag, buffer, buff_len, level ); \
  169. } \
  170. } while(0)
  171. /**
  172. * @brief Dump a buffer to the log at specified level.
  173. *
  174. * The dump log shows just like the one below:
  175. *
  176. * W (195) log_example: 0x3ffb4280 45 53 50 33 32 20 69 73 20 67 72 65 61 74 2c 20 |ESP32 is great, |
  177. * W (195) log_example: 0x3ffb4290 77 6f 72 6b 69 6e 67 20 61 6c 6f 6e 67 20 77 69 |working along wi|
  178. * W (205) log_example: 0x3ffb42a0 74 68 20 74 68 65 20 49 44 46 2e 00 |th the IDF..|
  179. *
  180. * It is highly recommend to use terminals with over 102 text width.
  181. *
  182. * @param tag description tag
  183. * @param buffer Pointer to the buffer array
  184. * @param buff_len length of buffer in bytes
  185. * @param level level of the log
  186. */
  187. #define ESP_LOG_BUFFER_HEXDUMP( tag, buffer, buff_len, level ) \
  188. do { \
  189. if ( LOG_LOCAL_LEVEL >= (level) ) { \
  190. esp_log_buffer_hexdump_internal( tag, buffer, buff_len, level); \
  191. } \
  192. } while(0)
  193. /**
  194. * @brief Log a buffer of hex bytes at Info level
  195. *
  196. * @param tag description tag
  197. * @param buffer Pointer to the buffer array
  198. * @param buff_len length of buffer in bytes
  199. *
  200. * @see ``esp_log_buffer_hex_level``
  201. *
  202. */
  203. #define ESP_LOG_BUFFER_HEX(tag, buffer, buff_len) \
  204. do { \
  205. if (LOG_LOCAL_LEVEL >= ESP_LOG_INFO) { \
  206. ESP_LOG_BUFFER_HEX_LEVEL( tag, buffer, buff_len, ESP_LOG_INFO ); \
  207. }\
  208. } while(0)
  209. /**
  210. * @brief Log a buffer of characters at Info level. Buffer should contain only printable characters.
  211. *
  212. * @param tag description tag
  213. * @param buffer Pointer to the buffer array
  214. * @param buff_len length of buffer in bytes
  215. *
  216. * @see ``esp_log_buffer_char_level``
  217. *
  218. */
  219. #define ESP_LOG_BUFFER_CHAR(tag, buffer, buff_len) \
  220. do { \
  221. if (LOG_LOCAL_LEVEL >= ESP_LOG_INFO) { \
  222. ESP_LOG_BUFFER_CHAR_LEVEL( tag, buffer, buff_len, ESP_LOG_INFO ); \
  223. }\
  224. } while(0)
  225. /** @cond */
  226. //to be back compatible
  227. #define esp_log_buffer_hex ESP_LOG_BUFFER_HEX
  228. #define esp_log_buffer_char ESP_LOG_BUFFER_CHAR
  229. #if CONFIG_LOG_COLORS
  230. #define LOG_COLOR_BLACK "30"
  231. #define LOG_COLOR_RED "31"
  232. #define LOG_COLOR_GREEN "32"
  233. #define LOG_COLOR_BROWN "33"
  234. #define LOG_COLOR_BLUE "34"
  235. #define LOG_COLOR_PURPLE "35"
  236. #define LOG_COLOR_CYAN "36"
  237. #define LOG_COLOR(COLOR) "\033[0;" COLOR "m"
  238. #define LOG_BOLD(COLOR) "\033[1;" COLOR "m"
  239. #define LOG_RESET_COLOR "\033[0m"
  240. #define LOG_COLOR_E LOG_COLOR(LOG_COLOR_RED)
  241. #define LOG_COLOR_W LOG_COLOR(LOG_COLOR_BROWN)
  242. #define LOG_COLOR_I LOG_COLOR(LOG_COLOR_GREEN)
  243. #define LOG_COLOR_D
  244. #define LOG_COLOR_V
  245. #else //CONFIG_LOG_COLORS
  246. #define LOG_COLOR_E
  247. #define LOG_COLOR_W
  248. #define LOG_COLOR_I
  249. #define LOG_COLOR_D
  250. #define LOG_COLOR_V
  251. #define LOG_RESET_COLOR
  252. #endif //CONFIG_LOG_COLORS
  253. #define LOG_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%u) %s: " format LOG_RESET_COLOR "\n"
  254. #define LOG_SYSTEM_TIME_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%s) %s: " format LOG_RESET_COLOR "\n"
  255. /** @endcond */
  256. /// macro to output logs in startup code, before heap allocator and syscalls have been initialized. log at ``ESP_LOG_ERROR`` level. @see ``printf``,``ESP_LOGE``,``ESP_DRAM_LOGE``
  257. #define ESP_EARLY_LOGE( tag, format, ... ) ESP_LOG_EARLY_IMPL(tag, format, ESP_LOG_ERROR, E, ##__VA_ARGS__)
  258. /// macro to output logs in startup code at ``ESP_LOG_WARN`` level. @see ``ESP_EARLY_LOGE``,``ESP_LOGE``, ``printf``
  259. #define ESP_EARLY_LOGW( tag, format, ... ) ESP_LOG_EARLY_IMPL(tag, format, ESP_LOG_WARN, W, ##__VA_ARGS__)
  260. /// macro to output logs in startup code at ``ESP_LOG_INFO`` level. @see ``ESP_EARLY_LOGE``,``ESP_LOGE``, ``printf``
  261. #define ESP_EARLY_LOGI( tag, format, ... ) ESP_LOG_EARLY_IMPL(tag, format, ESP_LOG_INFO, I, ##__VA_ARGS__)
  262. /// macro to output logs in startup code at ``ESP_LOG_DEBUG`` level. @see ``ESP_EARLY_LOGE``,``ESP_LOGE``, ``printf``
  263. #define ESP_EARLY_LOGD( tag, format, ... ) ESP_LOG_EARLY_IMPL(tag, format, ESP_LOG_DEBUG, D, ##__VA_ARGS__)
  264. /// macro to output logs in startup code at ``ESP_LOG_VERBOSE`` level. @see ``ESP_EARLY_LOGE``,``ESP_LOGE``, ``printf``
  265. #define ESP_EARLY_LOGV( tag, format, ... ) ESP_LOG_EARLY_IMPL(tag, format, ESP_LOG_VERBOSE, V, ##__VA_ARGS__)
  266. #ifdef BOOTLOADER_BUILD
  267. #define _ESP_LOG_EARLY_ENABLED(log_level) (LOG_LOCAL_LEVEL >= (log_level))
  268. #else
  269. /* For early log, there is no log tag filtering. So we want to log only if both the LOG_LOCAL_LEVEL and the
  270. currently configured min log level are higher than the log level */
  271. #define _ESP_LOG_EARLY_ENABLED(log_level) (LOG_LOCAL_LEVEL >= (log_level) && esp_log_default_level >= (log_level))
  272. #endif
  273. #define ESP_LOG_EARLY_IMPL(tag, format, log_level, log_tag_letter, ...) do { \
  274. if (_ESP_LOG_EARLY_ENABLED(log_level)) { \
  275. esp_rom_printf(LOG_FORMAT(log_tag_letter, format), esp_log_timestamp(), tag, ##__VA_ARGS__); \
  276. }} while(0)
  277. #ifndef BOOTLOADER_BUILD
  278. #define ESP_LOGE( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, tag, format, ##__VA_ARGS__)
  279. #define ESP_LOGW( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_WARN, tag, format, ##__VA_ARGS__)
  280. #define ESP_LOGI( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO, tag, format, ##__VA_ARGS__)
  281. #define ESP_LOGD( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_DEBUG, tag, format, ##__VA_ARGS__)
  282. #define ESP_LOGV( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_VERBOSE, tag, format, ##__VA_ARGS__)
  283. #else
  284. /**
  285. * Macro to output logs at ESP_LOG_ERROR level.
  286. *
  287. * @note This macro cannot be used when interrupts are disabled or inside an ISR. @see ``ESP_DRAM_LOGE``.
  288. *
  289. * @param tag tag of the log, which can be used to change the log level by ``esp_log_level_set`` at runtime.
  290. *
  291. * @see ``printf``
  292. */
  293. #define ESP_LOGE( tag, format, ... ) ESP_EARLY_LOGE(tag, format, ##__VA_ARGS__)
  294. /// macro to output logs at ``ESP_LOG_WARN`` level. @see ``ESP_LOGE``
  295. #define ESP_LOGW( tag, format, ... ) ESP_EARLY_LOGW(tag, format, ##__VA_ARGS__)
  296. /// macro to output logs at ``ESP_LOG_INFO`` level. @see ``ESP_LOGE``
  297. #define ESP_LOGI( tag, format, ... ) ESP_EARLY_LOGI(tag, format, ##__VA_ARGS__)
  298. /// macro to output logs at ``ESP_LOG_DEBUG`` level. @see ``ESP_LOGE``
  299. #define ESP_LOGD( tag, format, ... ) ESP_EARLY_LOGD(tag, format, ##__VA_ARGS__)
  300. /// macro to output logs at ``ESP_LOG_VERBOSE`` level. @see ``ESP_LOGE``
  301. #define ESP_LOGV( tag, format, ... ) ESP_EARLY_LOGV(tag, format, ##__VA_ARGS__)
  302. #endif // BOOTLOADER_BUILD
  303. /** runtime macro to output logs at a specified level.
  304. *
  305. * @param tag tag of the log, which can be used to change the log level by ``esp_log_level_set`` at runtime.
  306. * @param level level of the output log.
  307. * @param format format of the output log. see ``printf``
  308. * @param ... variables to be replaced into the log. see ``printf``
  309. *
  310. * @see ``printf``
  311. */
  312. #if CONFIG_LOG_TIMESTAMP_SOURCE_RTOS
  313. #define ESP_LOG_LEVEL(level, tag, format, ...) do { \
  314. if (level==ESP_LOG_ERROR ) { esp_log_write(ESP_LOG_ERROR, tag, LOG_FORMAT(E, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
  315. else if (level==ESP_LOG_WARN ) { esp_log_write(ESP_LOG_WARN, tag, LOG_FORMAT(W, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
  316. else if (level==ESP_LOG_DEBUG ) { esp_log_write(ESP_LOG_DEBUG, tag, LOG_FORMAT(D, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
  317. else if (level==ESP_LOG_VERBOSE ) { esp_log_write(ESP_LOG_VERBOSE, tag, LOG_FORMAT(V, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
  318. else { esp_log_write(ESP_LOG_INFO, tag, LOG_FORMAT(I, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
  319. } while(0)
  320. #elif CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM
  321. #define ESP_LOG_LEVEL(level, tag, format, ...) do { \
  322. if (level==ESP_LOG_ERROR ) { esp_log_write(ESP_LOG_ERROR, tag, LOG_SYSTEM_TIME_FORMAT(E, format), esp_log_system_timestamp(), tag, ##__VA_ARGS__); } \
  323. else if (level==ESP_LOG_WARN ) { esp_log_write(ESP_LOG_WARN, tag, LOG_SYSTEM_TIME_FORMAT(W, format), esp_log_system_timestamp(), tag, ##__VA_ARGS__); } \
  324. else if (level==ESP_LOG_DEBUG ) { esp_log_write(ESP_LOG_DEBUG, tag, LOG_SYSTEM_TIME_FORMAT(D, format), esp_log_system_timestamp(), tag, ##__VA_ARGS__); } \
  325. else if (level==ESP_LOG_VERBOSE ) { esp_log_write(ESP_LOG_VERBOSE, tag, LOG_SYSTEM_TIME_FORMAT(V, format), esp_log_system_timestamp(), tag, ##__VA_ARGS__); } \
  326. else { esp_log_write(ESP_LOG_INFO, tag, LOG_SYSTEM_TIME_FORMAT(I, format), esp_log_system_timestamp(), tag, ##__VA_ARGS__); } \
  327. } while(0)
  328. #endif //CONFIG_LOG_TIMESTAMP_SOURCE_xxx
  329. /** runtime macro to output logs at a specified level. Also check the level with ``LOG_LOCAL_LEVEL``.
  330. *
  331. * @see ``printf``, ``ESP_LOG_LEVEL``
  332. */
  333. #define ESP_LOG_LEVEL_LOCAL(level, tag, format, ...) do { \
  334. if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
  335. } while(0)
  336. /**
  337. * @brief Macro to output logs when the cache is disabled. log at ``ESP_LOG_ERROR`` level.
  338. *
  339. * @note Unlike normal logging macros, it's possible to use this macro when interrupts are
  340. * disabled or inside an ISR.
  341. *
  342. * Similar to @see ``ESP_EARLY_LOGE``, the log level cannot be changed per-tag, however
  343. * esp_log_level_set("*", level) will set the default level which controls these log lines also.
  344. *
  345. * Usage: `ESP_DRAM_LOGE(DRAM_STR("my_tag"), "format", or `ESP_DRAM_LOGE(TAG, "format", ...)`,
  346. * where TAG is a char* that points to a str in the DRAM.
  347. *
  348. * @note Placing log strings in DRAM reduces available DRAM, so only use when absolutely essential.
  349. *
  350. * @see ``esp_rom_printf``,``ESP_LOGE``
  351. */
  352. #define ESP_DRAM_LOGE( tag, format, ... ) ESP_DRAM_LOG_IMPL(tag, format, ESP_LOG_ERROR, E, ##__VA_ARGS__)
  353. /// macro to output logs when the cache is disabled at ``ESP_LOG_WARN`` level. @see ``ESP_DRAM_LOGW``,``ESP_LOGW``, ``esp_rom_printf``
  354. #define ESP_DRAM_LOGW( tag, format, ... ) ESP_DRAM_LOG_IMPL(tag, format, ESP_LOG_WARN, W, ##__VA_ARGS__)
  355. /// macro to output logs when the cache is disabled at ``ESP_LOG_INFO`` level. @see ``ESP_DRAM_LOGI``,``ESP_LOGI``, ``esp_rom_printf``
  356. #define ESP_DRAM_LOGI( tag, format, ... ) ESP_DRAM_LOG_IMPL(tag, format, ESP_LOG_INFO, I, ##__VA_ARGS__)
  357. /// macro to output logs when the cache is disabled at ``ESP_LOG_DEBUG`` level. @see ``ESP_DRAM_LOGD``,``ESP_LOGD``, ``esp_rom_printf``
  358. #define ESP_DRAM_LOGD( tag, format, ... ) ESP_DRAM_LOG_IMPL(tag, format, ESP_LOG_DEBUG, D, ##__VA_ARGS__)
  359. /// macro to output logs when the cache is disabled at ``ESP_LOG_VERBOSE`` level. @see ``ESP_DRAM_LOGV``,``ESP_LOGV``, ``esp_rom_printf``
  360. #define ESP_DRAM_LOGV( tag, format, ... ) ESP_DRAM_LOG_IMPL(tag, format, ESP_LOG_VERBOSE, V, ##__VA_ARGS__)
  361. /** @cond */
  362. #define _ESP_LOG_DRAM_LOG_FORMAT(letter, format) DRAM_STR(#letter " %s: " format "\n")
  363. #define ESP_DRAM_LOG_IMPL(tag, format, log_level, log_tag_letter, ...) do { \
  364. if (_ESP_LOG_EARLY_ENABLED(log_level)) { \
  365. esp_rom_printf(_ESP_LOG_DRAM_LOG_FORMAT(log_tag_letter, format), tag, ##__VA_ARGS__); \
  366. }} while(0)
  367. /** @endcond */
  368. #ifdef __cplusplus
  369. }
  370. #endif
  371. #endif /* __ESP_LOG_H__ */