Proposal: Extend log crate with contextual, typed, and fatal-level logging
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.5k
- Forks
- 289
- Avg merge
- 55m
- Merged PRs (30d)
- 1
Description
Motivation: Automotive Use Case
- Contextual / Hierarchical Logging
- Current target (module path) is too flat for complex automotive applications where multiple layers/modules may reuse common subsystems.
- Developers need to distinguish who logged what not only by module but also by parent/ancestor context.
- Add optional hierarchical context (e.g. ECU → Subsystem → Component).
- Such context could be attached automatically (per logger instance) and optionally extended by the user.
- Enables better traceability of log origins in safety-critical systems.
- Type-Aware Logging
- Today everything is stringified, discarding type info needed by automotive backends (e.g. DLT expects type fidelity: numeric vs string vs struct).
- Proposal: allow passing typed values directly (info!(42), info!("user_id" = 43), info!(User { id: 7 })).
- Preserves fidelity for DLT and similar tools, enables filtering/sorting, while staying backward-compatible and simple for developers.
- Fatal Log Level
- Current Error conflates recoverable and unrecoverable failures.
- Add a Fatal level for logging critical, fail-stop conditions.
- Essential for automotive where safety hazards must be identified and escalated distinctly.
Benefits
- Improves interoperability with standards (e.g. DLT, AUTOSAR logging).
- Strengthens suitability for safety-critical domains (ISO 26262 compliance).
- Still lightweight: could be added as opt-in features, maintaining compatibility.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the current logging levels, module-path targets, and info! usage described in the proposal. Define the scope and compatibility requirements for hierarchical context, typed values, and a fatal level; done requires an agreed design covering all three areas before implementation begins.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100