Skip to main content

LogStorage

Trait LogStorage 

Source
pub trait LogStorage {
    // Required methods
    fn pop_logs(&self) -> Vec<Value>;
    fn get_log_by_id(&self, id: &str) -> Option<Value>;
    fn get_log_ids(&self) -> Vec<String>;
    fn get_logs_by_tag(&self, tag: &str) -> Vec<Value>;
    fn get_logs_by_request_id(&self, request_id: &str) -> Vec<Value>;
    fn get_logs_by_request_id_and_tag(
        &self,
        request_id: &str,
        tag: &str,
    ) -> Vec<Value>;
}
Expand description

Log Storage interface for getting log entries from the storage

Required Methods§

Source

fn pop_logs(&self) -> Vec<Value>

Return logs and remove them from the storage

Source

fn get_log_by_id(&self, id: &str) -> Option<Value>

Get specific log entry

Source

fn get_log_ids(&self) -> Vec<String>

Returns a list of all log ids

Source

fn get_logs_by_tag(&self, tag: &str) -> Vec<Value>

Get logs by tag, like log_kind or log level. Tag can be log_kind, log_level.

Source

fn get_logs_by_request_id(&self, request_id: &str) -> Vec<Value>

Get logs by request_id. Return log entries that match the given request_id.

Source

fn get_logs_by_request_id_and_tag( &self, request_id: &str, tag: &str, ) -> Vec<Value>

Get log by request_id and tag, like composite key request_id + log_kind. Tag can be log_kind, log_level. Return log entries that match the given request_id and tag.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§