blob: 86791ab30ae83f0b25f52979fd5b02d1d84f1ce7 (
plain)
1
2
3
4
5
6
7
8
9
10
|
use std::process::Command;
use std::io;
pub fn get_log(unit: &str, lines: i32) -> io::Result<String> {
let status = try!(Command::new("journalctl")
.args(&["-u", unit,
"-n", &lines.to_string()])
.output());
Ok(String::from_utf8_lossy(&status.stdout).into_owned())
}
|