Closed leifclaesson closed 2 years ago
Thanks for this I will look at excluding any Serials if NO_GLOBAL_SERIAL is defined
Ah! I get it now. I hadn't considered that it might be intentional, to let certain error messages through even when not debugging.
In that case, may I suggest an alternative solution -- PANGO_PRINT with a severity level?
Because, in my own projects, even on projects where I've set NO_GLOBAL_SERIAL, I still have debug console output through telnet. If you make a lambda hook for critical messages, I'll hook it to my console so that I'll see them.
Yes, you got it...dumphex is always available (even when not in debug mode), as it shows the contents of the packet. It is a simple job to #ifdef that out though.
A few places in both PANGO.cpp and PangolinMQTT.cpp reference Serial directly, rather than PANGO_PRINT, which fails due to Serial not being defined if a project is compiled with NO_GLOBAL_SERIAL, commonly used when you run out of pins on the ESP8266 and need to reuse the serial port pins. :)
I realize the library is in alpha-state so it's probably way too early for a pull request -- figured I'd just mentioned it here instead.