-
Notifications
You must be signed in to change notification settings - Fork 6
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
Restore "Print a message" recipe #14
Comments
Add |
This isn't very actionable, and the recipes aren't even in the main devhub repo anymore. FWIW the original code snippet is still basically correct except that it now comes from |
@bkchr has observed learners asking for help with printing simple debugging lines, so this issue is still relevant. He suggested we teach them to use https://crates.parity.io/sp_runtime/fn.print.html I suggest we demonstrate this technique in the PoE tutorial. The snippet I quoted above is still basically right, but we need to run the node with |
You can also show |
In the older runtime recipes that I deleted in 1495d8616b40, There was a section called "Print a message" which showed how to output simple debugging logs. That is not in the new https://substrate.dev/recipes .
I recently saw @shawntabrizi recommend instead to
println!
sIs this a better approach?
Original
Sometimes we need to print debug messages while building applications. This recipe shows how to print messages for debugging your Substrate runtime code.
You need to include
runtime_io
crate from the Substrate core in order to use IO functions from within the runtime modules.When this function is executed, the message will appear on the terminal where the Substrate node is running. The following screenshot shows the printed message.
The text was updated successfully, but these errors were encountered: