log: Allow setting maximum log level higher than default

Main change is possibility the log cache locking functions will
be called before the scheduler has started.

This change doesn't change the behaviour of ESP_EARLY_LOGx, this is
done in the following commit.

Closes https://github.com/espressif/esp-idf/issues/5542
This commit is contained in:
Angus Gratton
2021-03-11 20:17:21 +11:00
parent 6e80811ca2
commit 6bd9580137
3 changed files with 70 additions and 8 deletions

View File

@@ -46,7 +46,7 @@ typedef int (*vprintf_like_t)(const char *, va_list);
* If logging for given component has already been enabled, changes previous setting.
*
* Note that this function can not raise log level above the level set using
* CONFIG_LOG_DEFAULT_LEVEL setting in menuconfig.
* CONFIG_LOG_MAXIMUM_LEVEL setting in menuconfig.
*
* 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
@@ -137,7 +137,7 @@ void esp_log_writev(esp_log_level_t level, const char* tag, const char* format,
#ifndef LOG_LOCAL_LEVEL
#ifndef BOOTLOADER_BUILD
#define LOG_LOCAL_LEVEL CONFIG_LOG_DEFAULT_LEVEL
#define LOG_LOCAL_LEVEL CONFIG_LOG_MAXIMUM_LEVEL
#else
#define LOG_LOCAL_LEVEL CONFIG_BOOTLOADER_LOG_LEVEL
#endif