Skip to content

Commit c4db3c2

Browse files
committed
Fixed logging
1 parent 961ae8d commit c4db3c2

2 files changed

Lines changed: 8 additions & 15 deletions

File tree

.claude/agents/pr-reviewer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ For each changed file, evaluate:
7575
#### Convention compliance (from CLAUDE.md)
7676

7777
- `expect("should ...")` instead of `unwrap()` in production code
78-
- `thiserror` for library errors, `anyhow` for application-level
79-
- `tracing` macros (not `println!`)
78+
- `error-stack` (`Report<E>`) with `derive_more::Display` for errors (not thiserror/anyhow)
79+
- `log` macros (not `println!`)
8080
- `vi.hoisted()` for mock definitions in JS tests
8181
- Integration IDs match JS directory names
8282
- Colocated tests with `#[cfg(test)]`

CLAUDE.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ pub struct UserId(Uuid);
156156

157157
### Crate Preferences
158158

159-
- `tracing` (not `log`) for instrumentation.
159+
- `log` (with `log-fastly`) for instrumentation.
160160
- `similar_asserts` for test assertions.
161161
- `insta` for snapshot tests.
162162

@@ -215,19 +215,12 @@ impl core::error::Error for MyError {}
215215

216216
---
217217

218-
## Tracing Practices
218+
## Logging Practices
219219

220-
- Use level-specific macros: `info!`, `debug!`, `trace!`, `warn!`, `error!`.
221-
- Provide structured data as named arguments.
220+
- Use `log` crate level-specific macros: `log::info!`, `log::debug!`, `log::trace!`, `log::warn!`, `log::error!`.
221+
- Provide context in log messages with format strings.
222222
- Format messages with present-tense verbs.
223-
- Apply `#[tracing::instrument]` with `err`, `skip()`, and `fields()`:
224-
225-
```rust
226-
#[tracing::instrument(level = "debug", err, skip(password), fields(user_id = user.id))]
227-
async fn authenticate_user(user: &User, password: &[u8]) -> Result<AuthToken, AuthError> {
228-
// ...
229-
}
230-
```
223+
- Use `log-fastly` as the backend for Fastly Compute.
231224

232225
---
233226

@@ -395,7 +388,7 @@ both runtime behavior and build/tooling changes.
395388
## What NOT to Do
396389

397390
- Do not add unnecessary dependencies without justification.
398-
- Do not use `println!` / `eprintln!` — use `tracing` macros.
391+
- Do not use `println!` / `eprintln!` — use `log` macros.
399392
- Do not use `unwrap()` in production code — use `expect("should ...")`.
400393
- Do not use thiserror — use `derive_more::Display` + `impl Error`.
401394
- Do not use wildcard imports.

0 commit comments

Comments
 (0)