Add autosave functionality to BasicLogger #13679
Closed
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 pull request introduces an autosave feature to the
BasicLogger
class in the Vassal application. The most important changes include the addition of a scheduled executor service to handle periodic autosaving, the implementation of the autosave logic, and modifications to thewrite
method to support writing to a specified file. We simply append the word autosave_ to the current file we are logging to and then save to that file every 5 minutes.Autosave Feature Implementation:
ScheduledExecutorService
toBasicLogger
for scheduling periodic tasks. [1] [2]startAutosave
method to schedule theautosave
method at fixed intervals.autosave
method to handle the logic of saving the log file periodically.Modifications to Writing Logic:
write
method to support writing to a specified file, used by the autosave feature.Localization:
VASSAL.properties
.