This commit is contained in:
Robin Appelman 2024-07-25 23:11:23 +02:00
commit b5be612307
3 changed files with 20 additions and 21 deletions

View file

@ -58,8 +58,8 @@ impl Matcher {
}
for (i, log_match) in self.matches.iter().enumerate() {
if log_match.has_meaningful_message {
if log.level.matches(log_match.level)
if log_match.has_meaningful_message
&& log.level.matches(log_match.level)
&& log_match.pattern.is_match(log.message.as_str())
&& log_match.pattern_length >= best_length
{
@ -77,7 +77,6 @@ impl Matcher {
});
}
}
}
// todo: handle translated log messages
@ -129,7 +128,7 @@ impl Display for MatchResultDisplay<'_> {
if i > 0 {
write!(f, " or ")?;
}
write!(f, "{statement}\n")?;
writeln!(f, "{statement}")?;
}
}
Ok(())

View file

@ -29,11 +29,11 @@ pub fn match_list(app: &App) -> Table {
Constraint::Min(10),
];
let all = log_row(&app.all, &app, "All lines");
let all = log_row(&app.all, app, "All lines");
let unmatched = if app.unmatched.lines.is_empty() {
Either::Right(empty())
} else {
Either::Left(once(log_row(&app.unmatched, &app, "Unmatched lines")))
Either::Left(once(log_row(&app.unmatched, app, "Unmatched lines")))
};
Table::new(

View file

@ -26,7 +26,7 @@ pub fn raw_logs(app: &App, lines: &[usize]) -> Table<'static> {
Constraint::Percentage(100),
Constraint::Length(27),
];
let table = Table::new(lines.map(|line| log_row(line)), widths)
let table = Table::new(lines.map(log_row), widths)
.header(header)
.highlight_style(TABLE_SELECTED_STYLE)
.highlight_spacing(HighlightSpacing::Always);