pub trait LogAnalyzer {
Show 17 methods
// Required methods
fn add_log(
&self,
source_type: usize,
source_address: &str,
format: Option<&String>,
) -> Result<()>;
fn add_format(&self, alias: &str, regex: &str) -> Result<()>;
fn add_search(&self, regex: &str);
fn add_filter(&self, filter: Filter);
fn get_log_lines(&self, from: usize, to: usize) -> Vec<LogLine>;
fn get_search_lines(&self, from: usize, to: usize) -> Vec<LogLineStyled>;
fn get_log_lines_containing(
&self,
index: usize,
elements: usize,
) -> (Vec<LogLine>, usize, usize);
fn get_search_lines_containing(
&self,
index: usize,
elements: usize,
) -> (Vec<LogLineStyled>, usize, usize);
fn get_logs(&self) -> Vec<(bool, String, Option<String>)>;
fn get_formats(&self) -> Vec<Format>;
fn get_filters(&self) -> Vec<(bool, Filter)>;
fn get_total_raw_lines(&self) -> usize;
fn get_total_filtered_lines(&self) -> usize;
fn get_total_searched_lines(&self) -> usize;
fn toggle_source(&self, id: &str);
fn toggle_filter(&self, id: &str);
fn on_event(&self) -> Receiver<Event>;
}Expand description
Main API of this crate
Required Methods§
Sourcefn 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
Sourcefn 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
Sourcefn add_search(&self, regex: &str)
fn add_search(&self, regex: &str)
Start a new search
Sourcefn add_filter(&self, filter: Filter)
fn add_filter(&self, filter: Filter)
Add a new filter to the list of available filters
Sourcefn 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]
Sourcefn 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]
Sourcefn 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)
Sourcefn 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)
Sourcefn 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
Sourcefn get_formats(&self) -> Vec<Format>
fn get_formats(&self) -> Vec<Format>
Get all the available formats
Sourcefn get_filters(&self) -> Vec<(bool, Filter)>
fn get_filters(&self) -> Vec<(bool, Filter)>
Get all the available filters together with their enabled state
Sourcefn get_total_raw_lines(&self) -> usize
fn get_total_raw_lines(&self) -> usize
Get how many lines are in the raw logs
Sourcefn get_total_filtered_lines(&self) -> usize
fn get_total_filtered_lines(&self) -> usize
Get how many lines are in the filtered log
Sourcefn get_total_searched_lines(&self) -> usize
fn get_total_searched_lines(&self) -> usize
Get how many lines are in the search log
Sourcefn toggle_source(&self, id: &str)
fn toggle_source(&self, id: &str)
Enable or disable the given source
Sourcefn toggle_filter(&self, id: &str)
fn toggle_filter(&self, id: &str)
Enable or disable the given filter