Skip to content

Commit 60c9f1c

Browse files
committed
Improve log messages in main.rs
1 parent 2629357 commit 60c9f1c

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/main.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use std::process::{Command, ExitCode};
55
use std::time::Duration;
6-
use std::{env, process, thread};
6+
use std::{env, thread};
77

88
use signal_hook::consts::{SIGABRT, SIGINT};
99
use signal_hook::iterator::Signals;
@@ -34,11 +34,7 @@ fn main() -> ExitCode {
3434
return ExitCode::FAILURE;
3535
}
3636
};
37-
println!(
38-
"Monitoring process {} started with parameters {}",
39-
process::id(),
40-
params,
41-
);
37+
println!("Monitoring process started with parameters {}", params);
4238
let exit_code = start_monitoring(params);
4339
println!("Monitoring process stopped");
4440
return exit_code;
@@ -55,15 +51,15 @@ fn start_monitoring(params: AuthMonitorParams) -> ExitCode {
5551
let mut signals = match Signals::new([SIGABRT, SIGINT]) {
5652
Ok(signals) => signals,
5753
Err(error) => {
58-
eprintln!("Error creating signals {}", error);
54+
eprintln!("Error creating signals: {}", error);
5955
return ExitCode::FAILURE;
6056
}
6157
};
6258
loop {
6359
auth_monitor.update(shutdown);
6460
match signals.pending().next() {
6561
Some(signal) => {
66-
println!("Received signal {}, stopping...", signal);
62+
println!("Received signal {}", signal);
6763
return ExitCode::SUCCESS;
6864
}
6965
None => thread::sleep(SLEEP_DURATION),

0 commit comments

Comments
 (0)