log

Function log 

Source
pub fn log(
    timestamp: SystemTime,
    buffer_id: Buffer,
    priority: Priority,
    pid: u16,
    thread_id: u16,
    tag: &str,
    message: &str,
) -> Result<(), Error>
Expand description

Construct and send a log entry (non-Android platforms).

This function allows you to create custom log entries with explicit control over all parameters. On non-Android platforms, it prints to stderr in logcat format.

§Parameters

  • timestamp: The timestamp for the log entry
  • buffer_id: The target log buffer
  • priority: The log priority level
  • pid: Process ID to associate with the log
  • thread_id: Thread ID to associate with the log
  • tag: The log tag string
  • message: The log message content

§Errors

Returns an error if the log entry cannot be formatted or written.

§Example


android_logd_logger::log(SystemTime::now(), Buffer::Main, Priority::Info, 0, 0, "tag", "message").unwrap();