Struct DlogutilConfig

Source
pub struct DlogutilConfig { /* private fields */ }
Expand description

A struct containing libdlogutil initialisation configuration.

Implementations§

Source§

impl DlogutilConfig

Source

pub fn create() -> Result<Self>

Creates a new DlogutilConfig struct to be filled with configuration.

Useful for dumping the logs of a specific thread in a multithreaded process.

§Returns
  • Ok(Self) - A handle to the config struct.
  • Err(std::io::Error) - An error.
§Errors
Source

pub fn filter_tid(&mut self, tid: i32) -> Result<()>

Enables retrieving only those logs that are logged by the thread with the given TID.

Useful for dumping the logs of a specific thread in a multithreaded process.

§Errors
Source

pub fn filter_pid(&mut self, pid: i32) -> Result<()>

Enables retrieving only those logs that are logged by the process with the given PID.

Useful for dumping the logs of a specific process.

§Errors
Source

pub fn filter_filterspec(&mut self, query: &str) -> Result<()>

Enables retrieving only those logs that match a given filter.

§Arguments
  • query - The filter query. For syntax, see dlogutil’s –help.
§Errors
Source

pub fn sorting_disable(&mut self) -> Result<()>

Disables log sorting for given log retrieval request.

Logs are still received in some order that is usually largely sorted, but if sorting is disabled logutil-side there may be cases where a log with a later timestamp is in front of a log with an earlier one. The use case here is performance, since the failure case above is rare.

§Errors
Source

pub fn sorting_enable(&mut self) -> Result<()>

Enables log sorting for given log retrieval request.

This is the default and generally makes sure that logs are in order, but has a modest performance cost.

§Errors
Source

pub fn sorting_enable_with_size(&mut self, entry_count: u32) -> Result<()>

Enables sorting, choosing the sort buffer size manually.

The count parameter influences the quality of sorting, but also memory usage. This version is a somewhat lower level version of sorting_enable. For more information on sorting quality, refer to the C library documentation.

§Arguments
  • entry_count - How many logs to keep at a given time. At least 1.
§Errors
Source

pub fn order_set(&mut self, sort_by: SortingOrder) -> Result<()>

Chooses a timestamp type by which returned logs are sorted by.

If the chosen timestamp is missing in the logs, currently they will not be sorted at all. This should, however, still become a reasonable order, since logs are usually stored sorted by one of timestamps. If only some logs are missing the chosen timestamp, ordering of the logs is undefined. See buffer_get_default_ts_type for the default.

§Errors
Source

pub fn buffer_add(&mut self, buf: BufferId) -> Result<()>

Adds a buffer whence logs will be taken to a request.

§Errors
Source

pub fn mode_set_continuous(&mut self) -> Result<()>

Set log retrieval mode to retrieving all the logs since the start of the system without an end.

This is similar to dlogutil in a default mode.

§Errors
Source

pub fn mode_set_monitor(&mut self) -> Result<()>

Set log retrieval mode to retrieving all the logs since the call without an end.

This is similar to dlogutil -m.

§Errors
Source

pub fn mode_set_dump(&mut self, entry_count: u32) -> Result<()>

Set log retrieval mode to dumping all the logs since the start of the system until the call (possibly a specified amount of the most recent of them instead).

This is similar to dlogutil -d. After dumping all the logs, get_log will signal this by returning TIZEN_ERROR_NO_DATA.

§Arguments
  • entry_count - Number of logs to be returned. It can be DLOGUTIL_MAX_DUMP_SIZE, in which case all the logs will be dumped.
§Errors
Source

pub fn mode_set_compressed_memory_dump( &mut self, compress_buffer: &str, ) -> Result<()>

Set log retrieval mode to dumping compressed historical logs.

This is similar to cat /var/log/dlog/xyz. After dumping all the logs, get_log will signal this by returning TIZEN_ERROR_NO_DATA.

§Arguments
  • compress_buffer - The name of the compression storage entry.
§Errors

Trait Implementations§

Source§

impl Drop for DlogutilConfig

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for DlogutilConfig

Source§

impl Sync for DlogutilConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.