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
Improve debug libp2p documentation #762
Comments
|
Also, should we document the debug strings? Perhaps we should have some structure on it like: |
|
@vasco-santos yes I think this would be helpful, and including some common debug string combos could be really helpful. Additionally, we may want to add the debug strings of each module to their respective readme/api docs to make it easier for folks to find specific ones. Some example combo strings I use:
|
|
I wrote a small proposal so that we can iterate on this FormatWe should have a more rigid format for libp2p modules, which can enable logging easily for each libp2p components. We can start by a standard where each interface exports its debug string (its name per https://github.com/libp2p/js-libp2p-interfaces/tree/master/src). These exported strings should be concatenated with the implementation naming. As an example: libp2p transport interface should export a debugString = ‘libp2p:transport”, and its implementations would create their debug string as We can even go a step forward and try to also bind libp2p core components with the logic aboce whenever possible. As an example, we can have components like the connectionManager and transportManager to have debug strings in the interface namespace scope: Also, we can leverage this opportunity to also tidy up the usage of This will be a “breaking change” in the logs string and in the transports where people rely on the Finally, the README each module should have a debug section with its underlying debug strings, aiming to enable users to do more custom logging without the need to look into the codebase/all logs. FAQ.mdIn the context of the FAQ, I suggest we create “areas” within the document, starting by the “Debug” area. The 3 main questions seem to be:
Let me know your thoughts We should also consider if we want to do: #378 |
vasco-santos commentedSep 29, 2020
There were several libp2p users having trouble with "silent" errors, like silent errors dialling incorrect bootstrap addresses (like: ws multiaddr pointing to a tcp port).
Users can enable debug mode by:
localStorage.debug = 'libp2p:*DEBUG=libp2p:*We should document that we use the debug module and that it can be used for debugging purposes for libp2p.
My suggestion is to create a FAQ document where we will be adding the most common questions libp2p users might have, and include there "How to debug".
@jacobheun what do you think?
The text was updated successfully, but these errors were encountered: