pub struct DltContextHandle { /* private fields */ }Expand description
Safe wrapper around C DLT context with RAII semantics
The context holds an internal reference to the application, ensuring the application remains registered as long as any context exists.
Implementations§
Source§impl DltContextHandle
impl DltContextHandle
Sourcepub fn context_id(&self) -> Result<DltId, DltError>
pub fn context_id(&self) -> Result<DltId, DltError>
Sourcepub fn trace_status(&self) -> DltTraceStatus
pub fn trace_status(&self) -> DltTraceStatus
Get the current trace status of the context
§Errors
Returns DltError if the context is invalid or the context is null
Sourcepub fn log_level(&self) -> DltLogLevel
pub fn log_level(&self) -> DltLogLevel
Get the current log level of the context
Sourcepub fn log(
&self,
log_level: DltLogLevel,
message: &str,
) -> Result<(), DltSysError>
pub fn log( &self, log_level: DltLogLevel, message: &str, ) -> Result<(), DltSysError>
Sourcepub fn log_write_start_custom_timestamp(
&self,
log_level: DltLogLevel,
timestamp_microseconds: u64,
) -> Result<DltLogWriter, DltSysError>
pub fn log_write_start_custom_timestamp( &self, log_level: DltLogLevel, timestamp_microseconds: u64, ) -> Result<DltLogWriter, DltSysError>
Start a complex log message with a custom timestamp. Can be used to hide original timestamps or to log event recorded earlier. The timestamp is a steady clock, starting from an arbitrary point in time, usually system start.
§Errors
Returns DltError if starting the log message fails
Sourcepub fn log_write_start(
&self,
log_level: DltLogLevel,
) -> Result<DltLogWriter, DltSysError>
pub fn log_write_start( &self, log_level: DltLogLevel, ) -> Result<DltLogWriter, DltSysError>
Sourcepub fn register_log_level_changed_listener(
&self,
) -> Result<Receiver<LogLevelChangedEvent>, DltError>
pub fn register_log_level_changed_listener( &self, ) -> Result<Receiver<LogLevelChangedEvent>, DltError>
Register a channel to receive log level change notifications
Returns a receiver that will get LogLevelChangeEvent
when the DLT daemon changes log levels
§Errors
Returns InternalError if callback registration with DLT fails