pub struct LogarchiveProvider { /* private fields */ }Expand description
Provides an implementation of FileProvider that enumerates the
required files at the correct paths on a from a provided logarchive.
§Example
use macos_unifiedlogs::filesystem::LogarchiveProvider;
use std::path::PathBuf;
let mut test_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
test_path.push("tests/test_data/system_logs_big_sur.logarchive");
let provider = LogarchiveProvider::new(test_path.as_path());Implementations§
Trait Implementations§
Source§impl FileProvider for LogarchiveProvider
impl FileProvider for LogarchiveProvider
Source§fn tracev3_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>
fn tracev3_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>
Provide iterator for tracev3 files
§Example
use macos_unifiedlogs::filesystem::LogarchiveProvider;
use macos_unifiedlogs::traits::FileProvider;
use macos_unifiedlogs::parser::collect_timesync;
use std::path::PathBuf;
let mut test_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
test_path.push("tests/test_data/system_logs_big_sur.logarchive");
let provider = LogarchiveProvider::new(test_path.as_path());
for mut entry in provider.tracev3_files() {
println!("TraceV3 file: {}", entry.source_path());
}Source§fn uuidtext_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>
fn uuidtext_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>
Provides an iterator of
UUIDText string files from the /var/db/uuidtext/XX/ directories,
where the XX is any two uppercase hex characters, along with the filename (i.e., the
filename from the source file. This should be a 30-character name containing only hex
digits. This should be a 30-character name containing only hex digits. It is important that
this is. accurate, or else strings will not be able to be referenced from the source file.Source§fn read_uuidtext(&self, uuid: &str) -> Result<UUIDText, Error>
fn read_uuidtext(&self, uuid: &str) -> Result<UUIDText, Error>
Reads a provided UUID file at runtime.
The UUID is obtaind by parsing the
tracev3 files. Reads will fail if the UUID does not exist
This avoids having to read all UUIDText files into memory.Source§fn read_dsc_uuid(&self, uuid: &str) -> Result<SharedCacheStrings, Error>
fn read_dsc_uuid(&self, uuid: &str) -> Result<SharedCacheStrings, Error>
Reads a provided UUID file at runtime.
The UUID is obtaind by parsing the
tracev3 files. Reads will fail if the UUID does not exist
This avoids having to read all SharedCacheStrings files into memory.Source§fn cached_uuidtext(&self, uuid: &str) -> Option<&UUIDText>
fn cached_uuidtext(&self, uuid: &str) -> Option<&UUIDText>
Check our cached
UUIDText data for stringsSource§fn cached_dsc(&self, uuid: &str) -> Option<&SharedCacheStrings>
fn cached_dsc(&self, uuid: &str) -> Option<&SharedCacheStrings>
Check our cached
SharedCacheStrings for stringsSource§fn dsc_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>
fn dsc_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>
Provides an iterator of shared string files from the
/var/db/uuidtext/dsc subdirectory,
along with the filename (i.e., the filename from the source file). This should be a
30-character name containing only hex digits. It is important that this is. accurate, or
else strings will not be able to be referenced from the source file.Source§fn update_uuid(&mut self, uuid: &str, uuid2: &str)
fn update_uuid(&mut self, uuid: &str, uuid2: &str)
Update our cached
UUIDText dataSource§fn update_dsc(&mut self, uuid: &str, uuid2: &str)
fn update_dsc(&mut self, uuid: &str, uuid2: &str)
Update our cached
SharedCacheStrings dataSource§fn timesync_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>
fn timesync_files(&self) -> Box<dyn Iterator<Item = Box<dyn SourceFile>>>
Provides an iterator of
.timesync files from the /var/db/diagnostics/timesync subdirectory.Auto Trait Implementations§
impl Freeze for LogarchiveProvider
impl RefUnwindSafe for LogarchiveProvider
impl Send for LogarchiveProvider
impl Sync for LogarchiveProvider
impl Unpin for LogarchiveProvider
impl UnwindSafe for LogarchiveProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more