Closed matthias-bs closed 1 year ago
The purpose of cEventLog
is to implement the actual debug printing in callback functions using RegisterListener().
This is not implemented entirely consistent; some Serial.print() function calls are still left in MCCI_Arduino_LoRaWAN_Library/src/lib/arduino_lorawan_cEventLog.cpp
.
This should be changed as follows:
bool
Arduino_LoRaWAN::cEventLog::processSingleEvent()
{
if (this->m_head == this->m_tail)
{
return false;
}
auto const pEvent = &this->m_queue[this->m_head];
//Serial.print(osticks2ms(pEvent->time));
//Serial.print(" ms:");
pEvent->pCallBack(pEvent);
//Serial.println();
if (++m_head == sizeof(m_queue) / sizeof(m_queue[0]))
{
m_head = 0;
}
return true;
}
N.B.: With Arduino logging functions (such as log_i()
) a timestamp is included in the output per default.
The
DEBUG_PRINTF
/DEBUG_PRINTF_TS
macros only allow switching debug messages on/off using the define_BWS_DEBUG_MODE_
inBresserWeatherSensorTTNCfg.h
.With the Arduino logging functions from https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h, the debug level can be set in a fine-grained, standardized way from the Arduino IDE (Tools->Core Debug Level: "<NONE|ERROR|WARN|INFO|DEBUG|VERBOSE>")