-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Serial logging to flexible logging #690
Merged
Merged
Conversation
This file contains 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
Add Logging class which inherits from Print class, to be able to route logging to USB Serial or to memory for display in the webpage. Adds a log webpage only visible when DEBUG_VIA_WEB is defined.
dalathegreat
approved these changes
Dec 22, 2024
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.
What
This PR reroutes Serial output to a Logging class, which for now only support compile time switching between serial output and web based log output, but this could be made more flexible in the future.
Example output below:
Why
To be able to see debug output through the web interface, for installations where serial logging is not very convenient. Also to be able to better see the order in which events etc. are happening.
How
The log output is placed in the same buffer as the web based can_logging, to save on memory and because both are not needed at the same time. If can logging is enabled, the web based logging is disabled. Also placing the output in memory seems to be much less cpu intensive than the serial-logging, where each byte is written separately to the hardware serial.
The display mechanism is the same as for the web based can-logging. Which means that load from the web transfer happens at the moment the user reloads the log page, which can be timed so it happens after the issue that someone may be trying to log and therefore has no influence on the issue.