@@ -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