-
-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Working on #42 it was very hard to figure out what was happening if something didn't work as expected. For example: one of my theory on #40 is with awkward timing, a connection may be closed just when fin-ack is sent, which may mean utp_call_on_state_change may never be executed, causing utp-native to wait until timeout until closed.
The reason why I came this far is because I enabled libutp's debug mode and added a lot of print statements to the bindings, as well as adding an identifier to the connection so I could make sure in the log statements what operation caused a problem.
Adding/Removing the log statements to find the cause of an error is stressful. Which is why I would like to propose to add debug support to the library itself so debugging can be easier.
- Add an incrementing number to the
utpandconnectioninstances that is passed-on to the bindings which allows to figure out which connection is doing what in a command line. - Add debug statements to the Bindings that can be activated with a
UTP_DEBUG_LOGGINGcompile time option. - Add
debugstatements to the Connection and UTP classes that also let know what happens when. - (Optional) Add debug builds of the binaries and load the debug builds if the
debug.enabledis true instead of the production binaries.