MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / append_boot_separator

Function append_boot_separator

vmm/src/app.rs:1082–1092  ·  view source on GitHub ↗

Append a boot separator line with timestamp to an append-mode log file.

(path: &std::path::Path)

Source from the content-addressed store, hash-verified

1080
1081/// Append a boot separator line with timestamp to an append-mode log file.
1082fn append_boot_separator(path: &std::path::Path) {
1083 use std::io::Write;
1084 if !path.exists() {
1085 return;
1086 }
1087 let Ok(mut file) = std::fs::OpenOptions::new().append(true).open(path) else {
1088 return;
1089 };
1090 let timestamp = humantime::format_rfc3339_seconds(std::time::SystemTime::now());
1091 let _ = writeln!(file, "\n===== boot @ {timestamp} =====\n");
1092}
1093
1094/// Append current serial.log into serial.history.log with a boot separator,
1095/// then truncate history if it exceeds `max_bytes`.

Callers 1

start_vmMethod · 0.85

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected