| Crates.io | dlt-rs |
| lib.rs | dlt-rs |
| version | 0.1.0 |
| created_at | 2025-12-01 14:05:03.090902+00 |
| updated_at | 2025-12-01 14:05:03.090902+00 |
| description | Safe and idiomatic Rust wrapper for the C library libdlt to provide DLT logging capabilities for Rust applications |
| homepage | https://github.com/eclipse-opensovd/dlt-tracing-lib |
| repository | |
| max_upload_size | |
| id | 1959802 |
| size | 42,987 |
Safe and idiomatic Rust wrapper for the COVESA DLT (Diagnostic Log and Trace) library.
dlt-rs provides a safe, ergonomic Rust API for logging to the COVESA DLT daemon. It wraps the low-level dlt-sys FFI bindings with a type-safe interface.
✅ Type-safe API - No unsafe code in your application
✅ Structured logging - Log typed fields (integers, floats, strings, etc.)
✅ RAII-based resource management - Automatic cleanup
✅ Thread-safe - Safe for concurrent use
✅ Zero-copy where possible for performance
✅ Dynamic log levels - Responds to DLT daemon configuration changes
use dlt_rs::{DltApplication, DltId, DltLogLevel};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Register application (one per process)
let app = DltApplication::register(
&DltId::new(b"MBTI")?,
"Measurement & Bus Trace Interface"
)?;
// Create a logging context
let ctx = app.create_context(
&DltId::new(b"CTX1")?,
"Main Context"
)?;
// Simple text logging
ctx.log(DltLogLevel::Info, "Hello DLT!")?;
Ok(())
}
use dlt_rs::{DltLogLevel};
// Log structured data with typed fields
let mut writer = ctx.log_write_start(DltLogLevel::Info)?;
writer
.write_string("Temperature:")?
.write_float32(87.5)?
.write_string("°C")?;
writer.finish()?;
For integration with the tracing ecosystem, see the tracing-dlt crate.
trace_load_ctrl - Enable DLT load control support (optional)Licensed under the Apache License, Version 2.0. See LICENSE for details.
This project is part of Eclipse OpenSOVD, but can be used independently. See CONTRIBUTING.md for guidelines.