From e2eae10db6d69199d27a4e430d9e551c46c391a9 Mon Sep 17 00:00:00 2001 From: Christian Baars Date: Fri, 2 May 2025 15:10:02 +0200 Subject: [PATCH] Fix log_level definition conflict (#23366) --- .../esp-nimble-cpp/src/NimBLELog.h | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/libesp32_div/esp-nimble-cpp/src/NimBLELog.h b/lib/libesp32_div/esp-nimble-cpp/src/NimBLELog.h index 0ccdf4163..686c71cd1 100644 --- a/lib/libesp32_div/esp-nimble-cpp/src/NimBLELog.h +++ b/lib/libesp32_div/esp-nimble-cpp/src/NimBLELog.h @@ -75,5 +75,28 @@ #define NIMBLE_LOGC( tag, format, ... ) console_printf("CRIT %s: " format "\n", tag, ##__VA_ARGS__) +// The LOG_LEVEL macros are used to set the log level for the NimBLE stack, but they pollute the global namespace and would override the loglevel enum of Tasmota. +// So we undefine them here to avoid conflicts. + +#ifdef LOG_LEVEL_DEBUG +#undef LOG_LEVEL_DEBUG +#endif + +#ifdef LOG_LEVEL_DEBUG_MORE +#undef LOG_LEVEL_DEBUG_MORE +#endif + +#ifdef LOG_LEVEL_INFO +#undef LOG_LEVEL_INFO +#endif + +#ifdef LOG_LEVEL_NONE +#undef LOG_LEVEL_NONE +#endif + +#ifdef LOG_LEVEL_ERROR +#undef LOG_LEVEL_ERROR +#endif + #endif /* CONFIG_BT_ENABLED */ #endif /* MAIN_NIMBLELOG_H_ */