wxecqz123
wxecqz123

Reputation: 335

How do I set up the logging for solana-test-validator?

I am following along here - https://docs.solana.com/developing/on-chain-programs/debugging

I have included this line in .bashrc

export RUST_LOG=solana_runtime::system_instruction_processor=trace,solana_runtime::message_processor=info,solana_bpf_loader=debug,solana_rbpf=debug

When I deploy a program to solana-test-validator and call the function the program completes sucessfully however the msg! calls in the rust program are not printing in the console.

I am getting command not found error for below. Do I have to configure the github cargo registry?

$RUST_LOG
solana_runtime::system_instruction_processor=trace,solana_runtime::message_processor=info,solana_bpf_loader=debug,solana_rbpf=debug: command not found

Upvotes: 5

Views: 5134

Answers (1)

Jon C
Jon C

Reputation: 8472

To see the msg! calls, you can use the solana logs tool, pointed at your local validator, by opening up another terminal and running:

solana logs --url localhost

Check out https://docs.solana.com/cli/usage#solana-logs for the full info on how to use it.

Upvotes: 9

Related Questions