Skip to content

Commit 9de76c5

Browse files
authored
mention tracing setup in docs (#283)
1 parent 9ac45e6 commit 9de76c5

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

CONTRIBUTING.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,29 @@ cargo test --features test-utils
6868
Run examples:
6969

7070
```bash
71-
RUST_LOG=info cargo run -p simple_counter
71+
RUST_LOG=info cargo run -p live_scanning
7272
# or
7373
RUST_LOG=info cargo run -p historical_scanning
7474
```
7575

76+
Logging / observability notes:
77+
78+
- The library's internal logs are **compile-time opt-in** via the `event-scanner` crate feature `tracing`.
79+
- If the feature is disabled, internal logging calls compile to **no-ops**.
80+
- Examples install a `tracing_subscriber` and read filters from `RUST_LOG`.
81+
82+
Enable `event-scanner` internal logs when running an example:
83+
84+
```bash
85+
RUST_LOG=event_scanner=debug cargo run -p historical_scanning --features event-scanner/tracing
86+
```
87+
88+
You can also combine filters to keep other dependencies quiet:
89+
90+
```bash
91+
RUST_LOG=warn,event_scanner=info cargo run -p historical_scanning --features event-scanner/tracing
92+
```
93+
7694
Note: Examples start a local `anvil` instance and deploy a demo contract.
7795

7896
---

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,12 @@ Run an example with:
278278
RUST_LOG=info cargo run -p live_scanning
279279
```
280280

281+
To also enable `event-scanner` internal logs in the examples:
282+
283+
```bash
284+
RUST_LOG=event_scanner=debug cargo run -p live_scanning --features event-scanner/tracing
285+
```
286+
281287
All examples spin up a local `anvil` instance, deploy a demo counter contract, and demonstrate using event streams to process events.
282288

283289
---

0 commit comments

Comments
 (0)