mirror of
https://codeberg.org/icewind/logsmash.git
synced 2026-06-03 18:14:11 +02:00
cleanup
This commit is contained in:
parent
595b6a1c75
commit
bce2ba3bf5
2 changed files with 15 additions and 24 deletions
|
|
@ -124,7 +124,7 @@ impl<'a> LogLine<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
#[derive(Deserialize, Debug, Hash)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct Exception<'a> {
|
||||
pub message: Cow<'a, str>,
|
||||
|
|
@ -133,15 +133,6 @@ pub struct Exception<'a> {
|
|||
pub line: usize,
|
||||
}
|
||||
|
||||
impl Hash for Exception<'_> {
|
||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
self.message.hash(state);
|
||||
self.exception.hash(state);
|
||||
self.file.hash(state);
|
||||
self.line.hash(state);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Clone)]
|
||||
pub struct FullLogLine {
|
||||
#[serde(rename = "reqId")]
|
||||
|
|
|
|||
|
|
@ -97,20 +97,20 @@ impl Matcher {
|
|||
break;
|
||||
}
|
||||
|
||||
if !log_match.pattern.is_empty() {
|
||||
if match_single(log_match.pattern, log.message.as_ref()) {
|
||||
best_length = log_match.pattern_len();
|
||||
best_match = Some(match best_match {
|
||||
Some(MatchResult::Single(res)) => {
|
||||
MatchResult::List(vec![res, log_match.index])
|
||||
}
|
||||
Some(MatchResult::List(mut list)) => {
|
||||
list.push(log_match.index);
|
||||
MatchResult::List(list)
|
||||
}
|
||||
None => MatchResult::Single(log_match.index),
|
||||
});
|
||||
}
|
||||
if !log_match.pattern.is_empty()
|
||||
&& match_single(log_match.pattern, log.message.as_ref())
|
||||
{
|
||||
best_length = log_match.pattern_len();
|
||||
best_match = Some(match best_match {
|
||||
Some(MatchResult::Single(res)) => {
|
||||
MatchResult::List(vec![res, log_match.index])
|
||||
}
|
||||
Some(MatchResult::List(mut list)) => {
|
||||
list.push(log_match.index);
|
||||
MatchResult::List(list)
|
||||
}
|
||||
None => MatchResult::Single(log_match.index),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue