feat(robin): M1 System Presence — journald/kmsg/inotify watcher, pattern classifier, tray badge, chat panel #2
1 changed files with 7 additions and 4 deletions
|
|
@ -57,7 +57,9 @@ pub async fn watch(log_paths: HashMap<String, String>, tx: mpsc::Sender<SystemEv
|
|||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
.await
|
||||
.ok();
|
||||
}
|
||||
|
||||
pub fn expand_tilde(path: &str) -> String {
|
||||
|
|
@ -77,9 +79,10 @@ pub fn read_new_lines(path: &str, from_byte: u64) -> (Vec<String>, u64) {
|
|||
if file.seek(std::io::SeekFrom::Start(from_byte)).is_err() {
|
||||
return (vec![], from_byte);
|
||||
}
|
||||
let mut content = String::new();
|
||||
let _ = file.read_to_string(&mut content);
|
||||
let new_pos = from_byte + content.len() as u64;
|
||||
let mut raw = Vec::new();
|
||||
let bytes_read = file.read_to_end(&mut raw).unwrap_or(0);
|
||||
let content = String::from_utf8_lossy(&raw).into_owned();
|
||||
let new_pos = from_byte + bytes_read as u64;
|
||||
let lines: Vec<String> = content
|
||||
.lines()
|
||||
.filter(|l| !l.is_empty())
|
||||
|
|
|
|||
Loading…
Reference in a new issue