Files
PhotonVision/photon-server/src/main/java/org
Craig Schardt 9d587d5746 Log fewer errors (#2246)
## Description

We currently log some things with ERROR status and include stack traces
for events that are typical behavior. This pollutes the logs and makes
it harder to track down real errors.

This PR changes the way that some events are logged:
* missing configs in the database are logged as [INFO] without the
exception stack trace.
* skip parsing NPU usage when the command is blank so that it doesn't
throw a NumberFormatException.
* log warn instead of error for unsupported NN backends (added by
@samfreund)
* skip warn when we don't add a model, only debug when we add it (added
by @samfreund)

Before:
```
Oct 22 20:56:26 photonvision java[831]: [2024-10-22 20:56:26] [Config - SqlConfigProvider] [ERROR] Could not deserialize apriltag layout! Loading defaults: Provided empty string for class edu.wpi.first.apriltag.AprilTagFieldLayout
Oct 22 20:56:26 photonvision java[831]: [2024-10-22 20:56:26] [Config - SqlConfigProvider] [ERROR] org.eclipse.jetty.io.EofException: Provided empty string for class edu.wpi.first.apriltag.AprilTagFieldLayout
Oct 22 20:56:26 photonvision java[831]:         at org.photonvision.common.util.file.JacksonUtils.deserialize(JacksonUtils.java:136)
Oct 22 20:56:26 photonvision java[831]:         at org.photonvision.common.configuration.SqlConfigProvider.load(SqlConfigProvider.java:298)
Oct 22 20:56:26 photonvision java[831]:         at org.photonvision.common.configuration.ConfigManager.load(ConfigManager.java:198)
Oct 22 20:56:26 photonvision java[831]:         at org.photonvision.Main.main(Main.java:290)
```

After:
```
Dec 15 22:29:09 photonvision java[662]: [2025-12-15 22:29:09] [Config - SqlConfigProvider] [INFO] Missing AprilTag Field Layout in database. Loading defaults
```

## 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_
- [ ] 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

---------

Co-authored-by: samfreund <samf.236@proton.me>
Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
2025-12-20 02:35:18 +00:00
..
2025-12-20 02:35:18 +00:00