mirror of
https://codeberg.org/icewind/logsmash.git
synced 2026-06-04 02:24:11 +02:00
better log message
This commit is contained in:
parent
c66517a931
commit
adb370e6bb
9 changed files with 62 additions and 19 deletions
|
|
@ -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),
|
||||
])
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
])
|
||||
|
|
|
|||
|
|
@ -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
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue