Add section on debugging output

coffeepots 2018-12-04 11:16:18 +00:00
parent bd3c6aad1e
commit 011a54e8e2
1 changed files with 30 additions and 0 deletions

@ -139,3 +139,33 @@ The number in bracket refers to the position after reading the opcode and its ar
[68] PUSH1 0x00
[69] SSTORE
```
## Debugging output
Nimbus outputs several tiers of debug information using the [Chronicles](https://github.com/status-im/nim-chronicles) library.
These are roughly split into several layers:
* Trace
* Debug
* Info
* Notice
* Warn
* Error
* Fatal
In code, these look like this:
`debug "Some debugging stuff", currentValue = value`
Chronicles allows several levels of control over output, and these can be controlled by compiler flags when building Nimbus. The Chronicles repo goes into depth about how these [flags operate](https://github.com/status-im/nim-chronicles#compile-time-configuration).
### Selecting output
#### Levels
When compiling using Nim with `debug`, Chronicles defaults to displaying debug and above messages, however this can be overridden by passing `-d:chronicles_log_level=` with one of the above levels. For example, you can compile using Nim's debug, but show only info level messages with `-d:chronicles_log_level=INFO`.
#### Colours
Some terminals don't support colour output and in this case you will see lots of extra characters that makes it difficult to read messages. To turn colouring off, you can use: `-d:chronicles_sinks=textlines[nocolors, stdout]`