Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better debug options #43

Open
martinheidegger opened this issue May 25, 2021 · 0 comments
Open

Better debug options #43

martinheidegger opened this issue May 25, 2021 · 0 comments

Comments

@martinheidegger
Copy link

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 utp and connection instances 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_LOGGING compile time option.
  • Add debug statements 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.enabled is true instead of the production binaries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant