mlesniew / PicoMQTT

ESP MQTT client and broker library
GNU Lesser General Public License v3.0
219 stars 25 forks source link

Debug options #6

Closed JohnCallingham closed 11 months ago

JohnCallingham commented 1 year ago

Hi Great library. Is there any way to add debug info? Thanks John

mlesniew commented 1 year ago

This can be done using preprocessor defines.

Build the library with PICOMQTT_DEBUG defined to get some extra diagnostic messages printed to the serial.

Build the library with PICOMQTT_DEBUG_TRACE_FUNCTIONS defined to make the library print (almost) all internal function calls and returns to the serial. Note that this is very verbose and will slow things down significantly, but it's very useful for debugging the library itself.

You can enable these options by adding a compiler flag or un-commenting one of the lines here: https://github.com/mlesniew/PicoMQTT/blob/master/src/PicoMQTT/config.h#L23

JohnCallingham commented 1 year ago

Many thanks

On 11 May 2023 22:04:20 BST, "Michał Leśniewski" @.***> wrote:

This can be done using preprocessor defines.

Build the library with PICOMQTT_DEBUG defined to get some extra diagnostic messages printed to the serial.

Build the library with PICOMQTT_DEBUG_TRACE_FUNCTIONS defined to make the library print (almost) all internal function calls and returns to the serial. Note that this is very verbose and will slow things down significantly, but it's very useful for debugging the library itself.

You can enable these options by adding a compiler flag or un-commenting one of the lines here: https://github.com/mlesniew/PicoMQTT/blob/master/src/PicoMQTT/config.h#L23

-- Reply to this email directly or view it on GitHub: https://github.com/mlesniew/PicoMQTT/issues/6#issuecomment-1544678430 You are receiving this because you authored the thread.

Message ID: @.***>