LogService

Struct LogService 

Source
pub struct LogService { /* private fields */ }

Implementations§

Source§

impl LogService

Source

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

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>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.