Make exported journalctl logs less verbose and always display everything (#2101)

## Description

There was a recent occurance of journalctl logs saying something like
`[66B blob data]`. We don't log anything binary, so journalctl might be
hiding some lines, thinking they're actually binary data when they're
actually plain text. Use `-a` to always log everything. If it's binary
data anyways, we'll want to know what it is anyways. Use `--output cat`
because we output our own timestamps and we don't want journalctl's own
timestamping. Filter the output through `sed` to remove ANSI color codes
to make reading logs easier.

## Meta

Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_
- [x] If this PR changes behavior or adds a feature, user documentation
is updated
- [ ] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [ ] If this PR touches configuration, this is backwards compatible
with settings back to v2025.3.2
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
This commit is contained in:
Gold856
2025-10-11 00:25:54 -04:00
committed by GitHub
parent 8ec041493a
commit 82d6b6b845
2 changed files with 5 additions and 3 deletions

View File

@@ -435,7 +435,7 @@ public class RequestHandler {
// dmesg = output all kernel logs since current boot
// cat /var/log/kern.log = output all kernel logs since first boot
shell.executeBashCommand(
"journalctl -u photonvision.service > "
"journalctl -a --output cat -u photonvision.service | sed -E 's/\\x1B\\[(0|30|31|32|33|34|35|36|37)m//g' >"
+ tempPath.toAbsolutePath()
+ " && dmesg > "
+ tempPath2.toAbsolutePath());