Struct log_analyzer::services::log_service::LogService
source · [−]pub struct LogService { /* private fields */ }Implementations
sourceimpl 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
sourceimpl LogAnalyzer for LogService
impl LogAnalyzer for LogService
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>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn get_log_lines(&self, from: usize, to: usize) -> Vec<LogLine>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Get log lines between the range [from, to]
sourcefn get_search_lines(&self, from: usize, to: usize) -> Vec<LogLine>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn get_search_lines(&self, from: usize, to: usize) -> Vec<LogLine>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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) Read more
sourcefn get_search_lines_containing(
&self,
index: usize,
elements: usize
) -> (Vec<LogLine>, usize, usize)
fn get_search_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) Read more
sourcefn get_logs(&self) -> Vec<(bool, String, Option<String>)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn get_logs(&self) -> Vec<(bool, String, Option<String>)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Get the current managed logs
Returns a vector of (enabled, log_path, Option
sourcefn get_formats(&self) -> Vec<Format>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn get_formats(&self) -> Vec<Format>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Get all the available formats
sourcefn get_filters(&self) -> Vec<(bool, Filter)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn get_filters(&self) -> Vec<(bool, Filter)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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
fn on_event(&self) -> Receiver<Event>
Auto Trait Implementations
impl !RefUnwindSafe for LogService
impl Send for LogService
impl Sync for LogService
impl Unpin for LogService
impl !UnwindSafe for LogService
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more