add print for each services asked.

This commit is contained in:
primardj 2024-04-11 17:08:36 +01:00
parent 940f2957e3
commit 28fb89caee

View file

@ -103,21 +103,48 @@ impl StatusObj {
}) })
} }
pub fn get_status_string(&mut self) -> String { pub fn get_status_string(&mut self) -> String {
dbg!(&self.svname); //dbg!(&self.svname);
dbg!(&self.svpath); dbg!(&self.svpath);
dbg!(self.time); dbg!(self.time);
dbg!(self.nano_seconds); dbg!(self.nano_seconds);
dbg!(self.pid); //dbg!(self.pid);
dbg!(self.pause_run); dbg!(self.pause_run);
dbg!(self.up_down); dbg!(self.up_down);
dbg!(self.term_sig); dbg!(self.term_sig);
dbg!(self.run_finish); //dbg!(self.run_finish);
dbg!(self.down); dbg!(self.down);
dbg!(self.log); dbg!(self.log);
// TODO // TODO
let status_sv;
let pid_string: String;
let down_string;
if self.run_finish == false {
status_sv = "down:";
pid_string = "".to_owned();
if self.down == false {
down_string = ", normally up";
} else {
down_string = "";
}
} else {
status_sv = "run:";
pid_string = "(pid ".to_owned() + &self.pid.to_string() + ") ";
if self.down == true {
down_string = ", normally down";
} else {
down_string = "";
}
}
return "Ta gueule".to_string(); let time_repaired: u64 = self.time; // TODO, change it to make the real tim eappear, of
// change misc::return_u8_in_u64
// Make return string with what made upper there.
let return_string: String = status_sv.to_owned() + " " + &self.svname + ": " + &pid_string + &time_repaired.to_string() + "s" + down_string;
return return_string;
} }
pub fn get_log(&mut self) -> bool { pub fn get_log(&mut self) -> bool {