Skip to content

Commit

Permalink
chore(docs): Aztec.nr logging page (#3281)
Browse files Browse the repository at this point in the history
  • Loading branch information
catmcgee authored Nov 10, 2023
1 parent aca2624 commit 11e6ca7
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/docs/dev_docs/debugging/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,31 @@ import DocCardList from '@theme/DocCardList';

On this section you can learn how to debug your Aztec.nr smart contracts and common errors that you may run into.

# Logging in Aztec.nr

You can log statements from Aztec.nr contracts that will show ups in the Sanbox.

**Import debug_log**
Import the [`debug_log`](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/aztec-nr/aztec/src/oracle/debug_log.nr) dependency from Aztec oracles:

```rust
use dep::aztec::oracle::debug_log::{ debug_log };
```

**Write log**
Write `debug_log()` in the appropriate place in your contract.

```rust
debug_log("here")
```

**Start Sandbox in debug mode**

Prepend the command to start the sandbox with `DEBUG=aztec` to log everything or `DEBUG=aztec:simulator:oracle` to only log your `debug_log()` statements.

```bash
cd ~./aztec && DEBUG=aztec docker-compose up
```


<DocCardList/>

0 comments on commit 11e6ca7

Please sign in to comment.