diff options
author | Daniel <kingdread@gmx.de> | 2020-04-18 15:10:59 +0200 |
---|---|---|
committer | Daniel <kingdread@gmx.de> | 2020-04-18 15:10:59 +0200 |
commit | 7030224fd2a97b3551fdd47c43249e3a42341238 (patch) | |
tree | e5986f57f186ab061db9030c5f10285c3eb6b6d7 /src/filters/log.rs | |
parent | 79752779036d31ee6427c731cd7c058eccf1034a (diff) | |
download | raidgrep-7030224fd2a97b3551fdd47c43249e3a42341238.tar.gz raidgrep-7030224fd2a97b3551fdd47c43249e3a42341238.tar.bz2 raidgrep-7030224fd2a97b3551fdd47c43249e3a42341238.zip |
make filters Debug
It's nice if you can print out the filter tree for debugging, so we're
requireing filters to be Debug now.
Diffstat (limited to 'src/filters/log.rs')
-rw-r--r-- | src/filters/log.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/filters/log.rs b/src/filters/log.rs index ded4c44..8b84bf3 100644 --- a/src/filters/log.rs +++ b/src/filters/log.rs @@ -47,6 +47,18 @@ impl OutcomeFilter { pub fn new(outcomes: HashSet<FightOutcome>) -> Box<dyn LogFilter> { Box::new(OutcomeFilter(outcomes)) } + + pub fn success() -> Box<dyn LogFilter> { + let mut outcomes = HashSet::new(); + outcomes.insert(FightOutcome::Success); + Self::new(outcomes) + } + + pub fn wipe() -> Box<dyn LogFilter> { + let mut outcomes = HashSet::new(); + outcomes.insert(FightOutcome::Wipe); + Self::new(outcomes) + } } impl Filter<PartialEvtc, LogResult> for OutcomeFilter { |