Boot log - #2938
Open
sergeuz wants to merge 52 commits into
Open
Conversation
sergeuz
marked this pull request as ready for review
August 7, 2026 11:08
sergeuz
marked this pull request as draft
August 7, 2026 11:58
sergeuz
marked this pull request as ready for review
August 7, 2026 14:15
…on of the current session; refactoring
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.
Stores the messages logged by the system and the application in a file so that they can be retrieved later — in particular the messages logged while the device is booting or when it's in safe mode, which the application can't see otherwise.
API
System.enableLogFile()— enable logging to a file. The log starts capturing the messages immediately. Can be called again to reconfigure the log.System.disableLogFile()— stop capturing the messages and delete the contents of the log.System.printLogFile()— print the contents of the log via the app's logger.System.readLogFile()— read the contents of the log into the application's own buffer.System.clearLogFile()— delete the contents of the log. The log keeps capturing the messages.Usage
Implementation
/sys/log.1and/sys/log.2, retaining the lastmax_sizebytes of the log data (50000 by default). Up to twice that amount of storage is used in the filesystem./sys/log_config, encoded with Protobuf.Known issues
Other changes
fs::File::close()now releases the file handle even if the file cannot be synced. Previously the file was left open from the caller's perspective while LittleFS had already freed its cache buffer, causing a use-after-free on the next write and a double free when the object was destroyed.fs::createTempFile()to create a uniquely named file under/tmp.