Skip to content

Commit 8611bcc

Browse files
committed
Log on run start/end
Fixes #4
1 parent 6769362 commit 8611bcc

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ serde = { version = "1.0.210", features = ["derive"] }
1212
serde_json = "1.0.128"
1313
stackable-operator = { git = "https://github.com/stackabletech/operator-rs", tag = "stackable-operator-0.78.0", version = "0.78.0" }
1414
sysinfo = "0.32.0"
15+
tracing = "0.1.40"
16+
tracing-subscriber = "0.3.18"
1517
users = "0.11.0"

src/main.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,16 @@ struct Opts {
2626
}
2727

2828
fn main() {
29+
tracing_subscriber::fmt().init();
30+
2931
let opts = Opts::parse();
3032

3133
let mut next_run = Instant::now();
3234
loop {
3335
std::thread::sleep(next_run.saturating_duration_since(Instant::now()));
3436

37+
tracing::info!("starting run");
38+
3539
// Please note that we use "new_all" to ensure that all list of
3640
// components, network interfaces, disks and users are already
3741
// filled!
@@ -102,7 +106,10 @@ fn main() {
102106
// - Users/Groups
103107

104108
match opts.loop_interval {
105-
Some(interval) => next_run += interval,
109+
Some(interval) => {
110+
next_run += interval;
111+
tracing::info!(?next_run, "run completed, scheduling next...");
112+
}
106113
None => break,
107114
}
108115
}

0 commit comments

Comments
 (0)