pub struct DlogutilConfig { /* private fields */ }Expand description
A struct containing libdlogutil initialisation configuration.
Implementations§
Source§impl DlogutilConfig
impl DlogutilConfig
Sourcepub fn create() -> Result<Self>
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
std::io::ErrorKind::OutOfMemory- Out of memory.
Sourcepub fn filter_tid(&mut self, tid: i32) -> Result<()>
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
std::io::ErrorKind::InvalidInput- The pointer was NULL.std::io::ErrorKind::OutOfMemory- Out of memory.
Sourcepub fn filter_pid(&mut self, pid: i32) -> Result<()>
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
std::io::ErrorKind::InvalidInput- The pointer was NULL.std::io::ErrorKind::OutOfMemory- Out of memory.
Sourcepub fn filter_filterspec(&mut self, query: &str) -> Result<()>
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
std::io::ErrorKind::InvalidInput- Invalid syntax of the filterspec.std::io::ErrorKind::InvalidInput- The pointer was NULL.std::io::ErrorKind::OutOfMemory- Out of memory.
Sourcepub fn sorting_disable(&mut self) -> Result<()>
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
std::io::ErrorKind::InvalidInput- The pointer was NULL.
Sourcepub fn sorting_enable(&mut self) -> Result<()>
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
std::io::ErrorKind::InvalidInput- The pointer was NULL.
Sourcepub fn sorting_enable_with_size(&mut self, entry_count: u32) -> Result<()>
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
std::io::ErrorKind::InvalidInput- Zero size.std::io::ErrorKind::InvalidInput- The pointer was NULL.
Sourcepub fn order_set(&mut self, sort_by: SortingOrder) -> Result<()>
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
std::io::ErrorKind::InvalidInput- The pointer was NULL.
Sourcepub fn buffer_add(&mut self, buf: BufferId) -> Result<()>
pub fn buffer_add(&mut self, buf: BufferId) -> Result<()>
Adds a buffer whence logs will be taken to a request.
§Errors
std::io::ErrorKind::InvalidInput- The pointer was NULL.
Sourcepub fn mode_set_continuous(&mut self) -> Result<()>
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
std::io::ErrorKind::InvalidInput- The pointer was NULL.
Sourcepub fn mode_set_monitor(&mut self) -> Result<()>
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
std::io::ErrorKind::InvalidInput- The pointer was NULL.
Sourcepub fn mode_set_dump(&mut self, entry_count: u32) -> Result<()>
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 beDLOGUTIL_MAX_DUMP_SIZE, in which case all the logs will be dumped.
§Errors
std::io::ErrorKind::InvalidInput- The pointer was NULL.
Sourcepub fn mode_set_compressed_memory_dump(
&mut self,
compress_buffer: &str,
) -> Result<()>
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
std::io::ErrorKind::OutOfMemory- Not enough memory. Parameters left unchanged.std::io::ErrorKind::InvalidInput- The pointer was NULL.