Reduce warning level to warn for some lines#396
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates logging to reduce severity from error to warning for several recoverable / client-driven conditions, reducing noise in error logs.
Changes:
- Downgrade “corrupted/invalid file” log from error to warning when responding with 404.
- Downgrade WebSocket and SSE queue overflow logs from error to warning when dropping messages / closing connections.
- Downgrade JSON request validation logs (oversized payload, unsupported chunked request) from error to warning.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/WebHandlers.cpp | Downgrades invalid/corrupt static file log severity to warning. |
| src/AsyncWebSocket.cpp | Downgrades “too many queued messages” logs to warning. |
| src/AsyncJson.cpp | Downgrades request validation/deserialization-related logs to warning. |
| src/AsyncEventSource.cpp | Downgrades SSE queue overflow logs to warning. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
If one of you guys please approve. Thanks ;-) |
Member
|
hmmm... I am not convinced this was a good approach. At least not for all. Please at least write a proper description on why you demote errors. |
Member
Author
done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is in relation to #395.
It reduces the log level of some messages from error to warning for these reasons:
the logs that are reduced are part of the normal process of the application (like discarding or closing connection when too many messages queued). These are not unrecoverable errors but more warnings to the user of a behavior that might impact his application, because of some external factors.
the level reduction also allows users to filter these logs. In example, a user could set ESP_IDF log level to error for async_ws in order to show sow these warnings if he does not care about them (if loss in websocket messages is acceptable, which can be a totally correct use case for an app streaming sensors events). So having these logs in warn allow a user to only log real unrecoverable errors like allocation failures.
Reducing log level also helps minimizing the normal logs from the app that goes through the ESP-IDF service forwarding logs to another sublayer (
esp_log_set_vprintf(...)) since users can filter normal async_ws logging more easily.