![]() Must be a non-NULL zero terminated string. Tag – Tag of the log to query current level. Get log level for a given tag, can be used to avoid expensive log statements. ![]() Only logs at this and lower verbosity levels will be shown.Įsp_log_level_t esp_log_level_get ( const char * tag ) Value “*” resets log level for all tags to the given value. To raise log level above the default one for a given file, define LOG_LOCAL_LEVEL to one of the ESP_LOG_* values, before including esp_log.h in this file. Note that this function can not raise log level above the level set using CONFIG_LOG_MAXIMUM_LEVEL setting in menuconfig. If logging for given component has already been enabled, changes previous setting. The most relevant examples that deal with logging are the following:įunctions void esp_log_level_set ( const char * tag, esp_log_level_t level ) For demonstration of log functionality, check ESP-IDF’s examples directory. The logging library is commonly used by most esp-idf components and examples. ![]() Log calls are thread-safe, i.e., logs of different threads do not conflict with each other. The log string is first written into a memory buffer and then sent to the UART for printing. For details, please refer to Section Logging to Host. By calling a simple API, all log output may be routed to JTAG instead, making logging several times faster. Logging to Host via JTAG īy default, the logging library uses the vprintf-like function to write formatted output to the dedicated UART. These macros will always log at the “default” verbosity level, which can only be changed at runtime by calling esp_log_level("*", level). The “DRAM” and “EARLY” log macro variants documented above do not support per module setting of log verbosity. Use of this macros should be as sparing as possible, as logging in these types of code should be avoided for performance reasons. These versions are used in some places where logging may occur with interrupts disabled or with flash cache inaccessible. There are also ESP_DRAM_LOGx versions for each of these macros, e.g. Normal ESP_LOGx macros can also be used while compiling the bootloader, but they will fall back to the same implementation as ESP_EARLY_LOGx macros. These versions have to be used explicitly in the early startup code only, before heap allocator and syscalls have been initialized. Several macros are available for different verbosity levels:Īdditionally, there are ESP_EARLY_LOGx versions for each of these macros, e.g. Requested: %d baud, actual: %d baud", error * 100, baud_req, baud_real ) ESP_LOGW ( TAG, "Baud rate error %.1f%%.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |