Disable certain logging features to make bootloader with log output small enough to fit into 48kb area

This commit is contained in:
2024-03-06 12:36:06 +01:00
parent d9fd7e602d
commit b2e1f274f1

View File

@@ -279,7 +279,7 @@ void esp_log_writev(esp_log_level_t level, const char* tag, const char* format,
#define esp_log_buffer_hex ESP_LOG_BUFFER_HEX #define esp_log_buffer_hex ESP_LOG_BUFFER_HEX
#define esp_log_buffer_char ESP_LOG_BUFFER_CHAR #define esp_log_buffer_char ESP_LOG_BUFFER_CHAR
#if CONFIG_LOG_COLORS #if CONFIG_LOG_COLORS && !defined(BOOTLOADER_BUILD)
#define LOG_COLOR_BLACK "30" #define LOG_COLOR_BLACK "30"
#define LOG_COLOR_RED "31" #define LOG_COLOR_RED "31"
#define LOG_COLOR_GREEN "32" #define LOG_COLOR_GREEN "32"
@@ -304,6 +304,17 @@ void esp_log_writev(esp_log_level_t level, const char* tag, const char* format,
#define LOG_RESET_COLOR #define LOG_RESET_COLOR
#endif //CONFIG_LOG_COLORS #endif //CONFIG_LOG_COLORS
#ifdef BOOTLOADER_BUILD
#define LOG_ADDITIONAL_ARGS \
__LINE__, \
__FUNCTION__
#define LOG_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%" PRIu32 ") %s %d %s(): " format LOG_RESET_COLOR "\n"
#define LOG_SYSTEM_TIME_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%s) %s %d %s(): " format LOG_RESET_COLOR "\n"
#else
#define LOG_ADDITIONAL_ARGS \ #define LOG_ADDITIONAL_ARGS \
(__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__), \ (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__), \
__LINE__, \ __LINE__, \
@@ -312,6 +323,8 @@ void esp_log_writev(esp_log_level_t level, const char* tag, const char* format,
#define LOG_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%" PRIu32 ") %s %s:%d %s(): " format LOG_RESET_COLOR "\n" #define LOG_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%" PRIu32 ") %s %s:%d %s(): " format LOG_RESET_COLOR "\n"
#define LOG_SYSTEM_TIME_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%s) %s %s:%d %s(): " format LOG_RESET_COLOR "\n" #define LOG_SYSTEM_TIME_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%s) %s %s:%d %s(): " format LOG_RESET_COLOR "\n"
#endif
/** @endcond */ /** @endcond */
/// macro to output logs in startup code, before heap allocator and syscalls have been initialized. /// macro to output logs in startup code, before heap allocator and syscalls have been initialized.