- In Rust, add
msg!("Some variable: {:?}", variable);
- Run
anchor test
to run the program through the tests. However you won't find the output there. - View the output instead in a file within your
program-logs
folder in your Anchor project. It'll be recreated each time you run the program.
This is subtly mentioned in the docs and can be found in the CLI docs here: https://book.anchor-lang.com/chapter_4/cli.html#test