Use the log crate to output contract generated messages. (#8403)

This commit is contained in:
Alexander Theißen
2021-03-21 14:49:44 +01:00
committed by GitHub
parent 4fd69de38e
commit 998d190ea0
2 changed files with 16 additions and 1 deletions
+15
View File
@@ -57,4 +57,19 @@ will make things a lot easier. One such language is [`ink`](https://github.com/p
which is an [`eDSL`](https://wiki.haskell.org/Embedded_domain_specific_language) that enables
writing WebAssembly based smart contracts in the Rust programming language.
## Debugging
Contracts can emit messages to the node console when run on a development chain through the
`seal_println` API. This is exposed in ink! via
[`ink_env::debug_println()`](https://docs.rs/ink_env/latest/ink_env/fn.debug_println.html).
In order to see these messages the log level for the `runtime::contracts` target needs to be raised
to at least the `info` level which is the default. However, those messages are easy to overlook
because of the noise generated by block production. A good starting point for contract debugging
could be:
```bash
cargo run --release -- --dev --tmp -lerror,runtime::contracts
```
License: Apache-2.0