pub struct ActionLoggerConfig {
pub include_patterns: Vec<String>,
pub exclude_patterns: Vec<String>,
}Expand description
Configuration for action logging with include/exclude filtering.
Patterns support:
*matches any sequence of characters?matches any single character- Literal text matches exactly
cat:<pattern>/category:<pattern>matches inferred action categoryname:<ActionName>matches exact action name (no wildcards)
§Examples
Search*matches SearchAddChar, SearchDeleteChar, etc.Did*matches DidConnect, DidScanKeys, etc.*Error*matches any action containing “Error”Tickmatches only Tickcat:searchmatchesSearchStart,SearchSubmit, etc.name:WeatherDidLoadmatches onlyWeatherDidLoadWeatherDid*uses normal glob name matching (withoutname:prefix)
Fields§
§include_patterns: Vec<String>If non-empty, only log actions matching these patterns
exclude_patterns: Vec<String>Exclude actions matching these patterns (applied after include)
Implementations§
Source§impl ActionLoggerConfig
impl ActionLoggerConfig
Sourcepub fn new(include: Option<&str>, exclude: Option<&str>) -> ActionLoggerConfig
pub fn new(include: Option<&str>, exclude: Option<&str>) -> ActionLoggerConfig
Create a new config from comma-separated pattern strings
§Arguments
include: comma-separated glob patterns (or None for all)exclude: comma-separated glob patterns (or None for default excludes)
§Example
use tui_dispatch_debug::debug::ActionLoggerConfig;
let config = ActionLoggerConfig::new(Some("Search*,Connect"), Some("Tick,Render"));
assert!(config.should_log("SearchAddChar"));
assert!(config.should_log("Connect"));
assert!(!config.should_log("Tick"));Sourcepub fn with_patterns(
include: Vec<String>,
exclude: Vec<String>,
) -> ActionLoggerConfig
pub fn with_patterns( include: Vec<String>, exclude: Vec<String>, ) -> ActionLoggerConfig
Create a config with specific pattern vectors
Sourcepub fn should_log(&self, action_name: &str) -> bool
pub fn should_log(&self, action_name: &str) -> bool
Check if an action name should be logged based on include/exclude patterns
Trait Implementations§
Source§impl Clone for ActionLoggerConfig
impl Clone for ActionLoggerConfig
Source§fn clone(&self) -> ActionLoggerConfig
fn clone(&self) -> ActionLoggerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ActionLoggerConfig
impl Debug for ActionLoggerConfig
Source§impl Default for ActionLoggerConfig
impl Default for ActionLoggerConfig
Source§fn default() -> ActionLoggerConfig
fn default() -> ActionLoggerConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ActionLoggerConfig
impl RefUnwindSafe for ActionLoggerConfig
impl Send for ActionLoggerConfig
impl Sync for ActionLoggerConfig
impl Unpin for ActionLoggerConfig
impl UnsafeUnpin for ActionLoggerConfig
impl UnwindSafe for ActionLoggerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more