From 7b5fb81fc7927809db90c1b093a0de939a54ecd9 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 15 Apr 2025 13:35:35 +0200 Subject: avoid need for external file mylog.h --- sensor/sensor.ino | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'sensor/sensor.ino') diff --git a/sensor/sensor.ino b/sensor/sensor.ino index 019ff23..5a1f075 100644 --- a/sensor/sensor.ino +++ b/sensor/sensor.ino @@ -22,7 +22,16 @@ /// @see /// @see -#include "mylog.h" +// include and refine ESP32 Logging system +// activate in Arduino IDE: Tools -> Core Debug Level +#define CONFIG_ARDUHAL_ESP_LOG 1 +#define LOG_LOCAL_LEVEL CORE_DEBUG_LEVEL +#include +#undef ARDUHAL_LOG_FORMAT +#define ARDUHAL_LOG_FORMAT(letter, format) \ + ARDUHAL_LOG_COLOR_##letter "[" #letter "] %s(): " format \ + ARDUHAL_LOG_RESET_COLOR "\r\n", __FUNCTION__ + #include "BLEDevice.h" #include "BLEBeacon.h" #include "BLEAdvertising.h" @@ -160,11 +169,10 @@ void setBeacon(int angle) { void setup() { - // enable logging (when also raised in IDE: Tools -> Core Debug Level) + // enable logging to serial Serial.begin(115200); esp_log_level_set("*", ESP_LOG_DEBUG); - Serial.begin(115200); beginPace(); beginTouchDetection(); -- cgit v1.2.3