pub struct LogService { /* private fields */ }Implementations§
Source§impl LogService
impl LogService
Sourcepub fn new(
log_store: Arc<dyn LogStore + Sync + Send>,
processing_store: Arc<dyn ProcessingStore + Sync + Send>,
analysis_store: Arc<dyn AnalysisStore + Sync + Send>,
) -> Arc<Self>
pub fn new( log_store: Arc<dyn LogStore + Sync + Send>, processing_store: Arc<dyn ProcessingStore + Sync + Send>, analysis_store: Arc<dyn AnalysisStore + Sync + Send>, ) -> Arc<Self>
Instantiates the service and starts the consumer thread.
The consumer thread continuously listens to lines from log sources and applies a chain of operations
- apply format
- apply filters
- apply search
Trait Implementations§
Source§impl LogAnalyzer for LogService
impl LogAnalyzer for LogService
Source§fn add_log(
&self,
source_type: usize,
source_address: &str,
format: Option<&String>,
) -> Result<()>
fn add_log( &self, source_type: usize, source_address: &str, format: Option<&String>, ) -> Result<()>
Add a new log source to the analysis
Source§fn add_format(&self, alias: &str, regex: &str) -> Result<()>
fn add_format(&self, alias: &str, regex: &str) -> Result<()>
Add a new format to the list of available formats
Source§fn add_search(&self, regex: &str)
fn add_search(&self, regex: &str)
Start a new search
Source§fn add_filter(&self, filter: Filter)
fn add_filter(&self, filter: Filter)
Add a new filter to the list of available filters
Source§fn get_log_lines(&self, from: usize, to: usize) -> Vec<LogLine>
fn get_log_lines(&self, from: usize, to: usize) -> Vec<LogLine>
Get log lines between the range [from, to]
Source§fn get_search_lines(&self, from: usize, to: usize) -> Vec<LogLineStyled>
fn get_search_lines(&self, from: usize, to: usize) -> Vec<LogLineStyled>
Get search lines between the range [from, to]
Source§fn get_log_lines_containing(
&self,
index: usize,
elements: usize,
) -> (Vec<LogLine>, usize, usize)
fn get_log_lines_containing( &self, index: usize, elements: usize, ) -> (Vec<LogLine>, usize, usize)
Get a list of log lines of
elements size centered on the line element or the closest
Returns (elements, offset, index)Source§fn get_search_lines_containing(
&self,
index: usize,
elements: usize,
) -> (Vec<LogLineStyled>, usize, usize)
fn get_search_lines_containing( &self, index: usize, elements: usize, ) -> (Vec<LogLineStyled>, usize, usize)
Get a list of log lines of
elements size centered on the line element or the closest
Returns (elements, offset, index)Source§fn get_logs(&self) -> Vec<(bool, String, Option<String>)>
fn get_logs(&self) -> Vec<(bool, String, Option<String>)>
Get the current managed logs
Returns a vector of (enabled, log_path, Option)
Source§fn get_formats(&self) -> Vec<Format>
fn get_formats(&self) -> Vec<Format>
Get all the available formats
Source§fn get_filters(&self) -> Vec<(bool, Filter)>
fn get_filters(&self) -> Vec<(bool, Filter)>
Get all the available filters together with their enabled state
Source§fn get_total_raw_lines(&self) -> usize
fn get_total_raw_lines(&self) -> usize
Get how many lines are in the raw logs
Source§fn get_total_filtered_lines(&self) -> usize
fn get_total_filtered_lines(&self) -> usize
Get how many lines are in the filtered log
Source§fn get_total_searched_lines(&self) -> usize
fn get_total_searched_lines(&self) -> usize
Get how many lines are in the search log
Source§fn toggle_source(&self, id: &str)
fn toggle_source(&self, id: &str)
Enable or disable the given source
Source§fn toggle_filter(&self, id: &str)
fn toggle_filter(&self, id: &str)
Enable or disable the given filter
fn on_event(&self) -> Receiver<Event>
Auto Trait Implementations§
impl !RefUnwindSafe for LogService
impl !UnwindSafe for LogService
impl Freeze for LogService
impl Send for LogService
impl Sync for LogService
impl Unpin for LogService
impl UnsafeUnpin for LogService
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