solana-bpf-logs-tracing

Crates.iosolana-bpf-logs-tracing
lib.rssolana-bpf-logs-tracing
version0.1.0
created_at2025-08-05 01:51:13.828407+00
updated_at2025-08-05 01:51:13.828407+00
descriptionAn procedural macro to trace logs in Solana programs.
homepagehttps://github.com/tuphan-dn/solana-bpf-logs-tracing
repositoryhttps://github.com/tuphan-dn/solana-bpf-logs-tracing
max_upload_size
id1781388
size5,567
Tu Phan (tuphan-dn)

documentation

README

Solana BPF Logs Tracing

A procedural macro to trace logs in Solana programs.

Features

  • Trace errors with filename and line number.
  • On-chain tracing is disabled in production, so your programs are unaffected when released.

Getting Started

Installation

Add the crate to your project:

cargo add solana-bpf-logs-tracing

Usage

Enable the tracing feature when building your program:

anchor build -- --features tracing

Apply the [trace] macro to any function you want to debug:

#[trace]
pub fn your_function() {
  // ...
}

NOTE: For release builds, omit the --features tracing flag to disable all [trace] macros in your program.

Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss your ideas.

License

MIT

Commit count: 0

cargo fmt