Logging — DLT base library with swappable backends

Requirements for the workspace-wide logging facade and its default DLT backend. The chapter introduces two new crates — taktora-log (the facade) and taktora-log-dlt (the DLT backend) — and documents how they coexist with the existing taktora-executor-tracing.

The design rationale, alternatives considered, and reference deployment context (COVESA dlt-daemon, AUTOSAR R20-11) live in the companion design doc docs/superpowers/specs/2026-05-18-taktora-log-dlt-design.md in the repository root.

The umbrella is split into eight capability-cluster sub-features. Each sub-feature :satisfies: an umbrella; each req :satisfies: exactly one capability-cluster feature. Each sub-feature has its own page (see the toctree): the facade (taktora-log facade crate (FEAT_0071)), the backend-swap surface (Backend-swap surface (FEAT_0073)), the tracing bridge (tracing-log bridge for exis... (FEAT_0078)), the DLT backend (taktora-log-dlt DLT-protoco... (FEAT_0072)), structured fields (Structured key-value fields... (FEAT_0074)), runtime log-level control (Runtime per-context log-lev... (FEAT_0075)), the offline ring buffer (Offline ring buffer with re... (FEAT_0076)), and the console dev fallback (Console dev fallback (FEAT_0077)).

Top-level umbrella

Feature: Shared logging base library FEAT_0070
status: approved

A workspace-wide logging surface used by every taktora crate and by any downstream connector. The umbrella satisfies two competing forces simultaneously:

  1. Vehicle integrators want DLT. The base library must speak AUTOSAR Diagnostic Log and Trace natively to a co-located COVESA dlt-daemon so taktora’s events surface in the same DLT Viewer / dlt-tui / backend-upload pipeline as everything else on the ECU.

  2. Non-vehicle integrators do not want DLT. Bench rigs, dev machines, CI, and third-party experiments must be able to swap DLT for log4rs / env_logger / a bespoke logger without touching any caller site.

The resolution is to commit to the rust-native log crate as the workspace logging facade (per log crate as workspace logg... (CON_0024)) and ship a DLT backend behind it (per taktora-log-dlt DLT-protoco... (FEAT_0072)). This mirrors the embassy-rs/embassy posture for std targets — log is the facade, the backend is chosen at process init.

The umbrella decomposes into the capability clusters below.

Requirements at a glance

Used filter:

ID

Title

Status

Satisfies

FEAT_0071

taktora-log facade crate

approved

FEAT_0070

FEAT_0072

taktora-log-dlt DLT-protocol backend

approved

FEAT_0070

FEAT_0073

Backend-swap surface

approved

FEAT_0071

FEAT_0074

Structured key-value fields mapped to DLT verbose args

approved

FEAT_0072

FEAT_0075

Runtime per-context log-level control

approved

FEAT_0072

FEAT_0076

Offline ring buffer with reconnect drain

approved

FEAT_0072

FEAT_0077

Console dev fallback

approved

FEAT_0071

FEAT_0078

tracing-log bridge for existing tracing emitters

approved

FEAT_0071

REQ_0800

Single facade for all taktora crates

implemented

FEAT_0071

REQ_0801

taktora-log re-exports log macros

implemented

FEAT_0071

REQ_0802

LogSink trait defines backend extension surface

implemented

FEAT_0071

REQ_0803

One-shot init builder selects the backend

implemented

FEAT_0071

REQ_0804

Integrator may install any log::Log implementation

implemented

FEAT_0073

REQ_0805

tracing-log bridge installed at init

implemented

FEAT_0078

REQ_0806

AUTOSAR Classic DLT R20-11 encoding via dlt-core

implemented

FEAT_0072

REQ_0807

UDS (default) and TCP transports to a local dlt-daemon

implemented

FEAT_0072

REQ_0808

4-character DLT App ID and Context ID per emitting crate

implemented

FEAT_0072

REQ_0809

log::kv pairs encoded as DLT verbose arguments

implemented

FEAT_0074

REQ_0810

Set-Log-Level and Set-Default-Log-Level control messages

implemented

FEAT_0075

REQ_0811

Production default level is INFO

implemented

FEAT_0075

REQ_0812

Emission shall not block the calling thread

implemented

FEAT_0076

REQ_0813

ERROR and FATAL emission shall not heap-allocate

approved

FEAT_0076

REQ_0814

Bounded in-memory ring buffers records while daemon is down

implemented

FEAT_0076

REQ_0815

Drop-oldest overflow policy with summary record on reconnect

approved

FEAT_0076

REQ_0816

Console fallback installed when no daemon and no other logger

approved

FEAT_0077