Skip to content

Commit

Permalink
docs: added logging section to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirko-von-Leipzig committed Jul 5, 2021
1 parent 310e942 commit 7d6d7bf
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,25 @@ Ziggurat's documentation can be built with `cargo doc --no-deps --open`.

Ziggurat currently uses rust's standard test runner, a simple `cargo test -- --test-threads=1` should suffice. We use the single threaded executor as spinning up multiple test nodes isn't currently supported.

### Logging

Logs are disabled by default, as they usually just add noise and slow down the test. They can be very useful for debugging and can be enabled on a test case level.

Ziggurat's `SyntheticNode` supports `tracing` - this can be enabled by inserting a call to `synthetic_node::enable_tracing()` inside the test case.

The test node's `stdout` and `stderr` logs can be piped to `stdout` by inserting a call to `node.log_to_stdout(true)` before starting the node. Note that logs will need to be enabled for the node as detailed in [Configuration](##Configuration).

```Rust
let mut node = Node::new().unwrap();
node.initial_action(Action::WaitForConnection)
.log_to_stdout(true) // pipe's the node's `stdout` and `stderr` to `stdout`
.start()
.await
.unwrap();
```

Tracing can also be enabled for Ziggurat's `SyntheticNode` by inserting a call to `synthetic_node::enable_tracing()`.

## Test Status

Short overview of test cases and their current status. In case of failure, the behaviour observed for `zebra` and `zcashd` is usually documented in the test case.
Expand Down

0 comments on commit 7d6d7bf

Please sign in to comment.