Include kernel logs when downloading logs (#1551)

Instead of writing the kernel logs to the photonvision logs, this will
download them in the same zip file as the photonvision logs. Only includes dmesg logs from the current boot, which is fine since we should capture most of them in our logs now.
This commit is contained in:
Craig Schardt
2024-11-11 23:41:22 -06:00
committed by GitHub
parent 1fc93bd05d
commit 31ec9baa95
2 changed files with 4 additions and 15 deletions

View File

@@ -424,10 +424,13 @@ public class RequestHandler {
ShellExec shell = new ShellExec();
var tempPath = Files.createTempFile("photonvision-journalctl", ".txt");
var tempPath2 = Files.createTempFile("photonvision-kernelogs", ".txt");
// In the command below:
// dmesg = output all kernel logs since current boot
// cat /var/log/kern.log = output all kernal logs since first boot
shell.executeBashCommand(
"journalctl -u photonvision.service > "
+ tempPath.toAbsolutePath()
+ " && journalctl -k > "
+ " && dmesg > "
+ tempPath2.toAbsolutePath());
while (!shell.isOutputCompleted()) {