better log message

This commit is contained in:
Robin Appelman 2024-07-26 22:44:59 +02:00
commit adb370e6bb
9 changed files with 62 additions and 19 deletions

View file

@ -37,7 +37,7 @@ fn log_row(line: &LogLine) -> Row<'static> {
Row::new([
Text::from(line.level.as_str().to_string()),
Text::from(line.app.to_string()),
Text::from(line.message.clone()),
Text::from(line.display()),
Text::from(line.time.format(&Iso8601::<TIME_FORMAT>).unwrap()).alignment(Alignment::Right),
])
}

View file

@ -40,7 +40,7 @@ fn group_row(app: &App, group: &GroupedLines) -> Row<'static> {
Row::new([
line.level.as_str().to_string(),
line.app.to_string(),
line.message.clone(),
line.display(),
sparkline(&group.histogram.counts(10)),
group.len().to_string(),
])

View file

@ -179,7 +179,11 @@ mod table_state {
fn up(&mut self, count: usize, step: usize) -> usize {
let current = self.selected().unwrap_or(0);
let after = if step > current {
count - 1
if step == 1 {
count - 1
} else {
0
}
} else {
current - step
};
@ -190,7 +194,11 @@ mod table_state {
fn down(&mut self, count: usize, step: usize) -> usize {
let current = self.selected().unwrap_or(0);
let after = if step >= count - current {
0
if step == 1 {
0
} else {
count - 1
}
} else {
current + step
};