LogAnalyzer

Trait LogAnalyzer 

Source
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§

Source

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<()>

Add a new format to the list of available formats

Start a new search

Source

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>

Get log lines between the range [from, to]

Source

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)

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)

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>)>

Get the current managed logs Returns a vector of (enabled, log_path, Option)

Source

fn get_formats(&self) -> Vec<Format>

Get all the available formats

Source

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

Get how many lines are in the raw logs

Source

fn get_total_filtered_lines(&self) -> usize

Get how many lines are in the filtered log

Source

fn get_total_searched_lines(&self) -> usize

Get how many lines are in the search log

Source

fn toggle_source(&self, id: &str)

Enable or disable the given source

Source

fn toggle_filter(&self, id: &str)

Enable or disable the given filter

Source

fn on_event(&self) -> Receiver<Event>

Implementors§