Repository navigation
VICTORY_LOG_FILE: append a run's log to a file - #12
Merged
Merged
Conversation
A second fmt layer appends every record to the file the env var names, alongside the console, so a run's output survives the window closing. Opened for appending, flushed per record; an unusable path is warned about and the run continues on the console alone. Co-authored-by: openhands <openhands@all-hands.dev>
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.
What changed
Set
VICTORY_LOG_FILE=<path>and every log record is appended to that file alongside the console output.Why
A title run's diagnosis lives in its console output, which is gone when the window closes or the machine reboots.
crashes.logonly appears on an unhandled exception, so a clean-looking run leaves no trace to read afterwards. With a log file, the whole run (device creation, the view-heap cap line, heap warnings, HLE blocks) is on disk for review and comparison across runs.How
victory-core/src/logging.rs: a secondfmtlayer with a file writer (sharedArc<Mutex<File>>handle, openedappend+create, flushed per record — each record lands whole even with worker threads logging concurrently).init; tests drive the new env-lessinit_with(Rust 2024 makesset_varunsafe, and parallel tests must not race on environment variables).VICTORY_LOG.Tests
file_log_appends: writes append, a later writer keeps earlier content (no truncation across runs).file_log_unusable: a path whose parents do not exist logs nothing to a file and does not panic.cargo test -p victory-core,cargo clippy -p victory-core --all-features --all-targetson x86_64-pc-windows-gnu: clean.This PR was created by an AI agent (OpenHands) on behalf of the user.