write_event_now

Function write_event_now 

Source
pub fn write_event_now<T: Into<EventValue>>(
    tag: EventTag,
    value: T,
) -> Result<(), Error>
Expand description

Writes an event with the current timestamp to the events buffer.

This is a convenience function that creates an event with the current system time and writes it to Buffer::Events.

§Parameters

  • tag: The event tag identifier
  • value: The event value (can be any type that converts to EventValue)

§Errors

Returns an error if the event data exceeds the maximum size.

§Examples

use android_logd_logger::{write_event, write_event_now, Error, Event, EventValue};
android_logd_logger::builder().init();

write_event_now(1, "test").unwrap();

let value: Vec<EventValue> = vec![1.into(), "one".into(), 123.3.into()].into();
write_event_now(2, value).unwrap();