[claude] Keep LcmDebugger run output in timestamped log files - #2507
Conversation
The console scrollback was the only record of a debug run. Each run now keeps its own log file, and dry run records land next to it rather than inside the throwaway project copy, where they went away with the copy. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Matches the codebase (DateTime.Now appears twice, DateTimeOffset across dozens of files) and clears a DeepSource bug-risk flag. Still local time: the name is read on the machine that produced the file. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two runs starting in the same second shared a name, and File.Create truncated the earlier run's records json. A nested project path threw at the end of the run, after the sync it was meant to record. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
An unhandled exception only reaches stderr, so the one run you most want a record of left nothing in the file. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Drops the split declaration DeepSource flagged, and a failure reading the snapshot or writing the records now reaches the log too. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughLcmDebugger now configures file logging, creates timestamped output paths, replaces console messages with structured logs, and writes separate JSON files for CRDT and fwdata dry-run records. ChangesLcmDebugger output pipeline
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
backend/FwLite/LcmDebugger/Program.cs (1)
23-29: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winLog failures before synchronization starts.
OpenDownloadedProjectexecutes before the catch inSyncFwHeadlessProject, so an open/init failure reaches stderr without being persisted to the run log. Wrap the scoped open-and-sync lifecycle in an application-level catch, log throughILoggerFactory, then rethrow.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@backend/FwLite/LcmDebugger/Program.cs` around lines 23 - 29, Wrap the scoped lifecycle containing OpenDownloadedProject and SyncFwHeadlessProject in an application-level try/catch so failures during project opening or synchronization are captured before escaping. In the catch, obtain the application logger through ILoggerFactory, persist the exception details to the run log, and rethrow the original exception; preserve the existing async scope and disposal behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/FwLite/LcmDebugger/RunOutput.cs`:
- Around line 11-18: Update the RunStarted identifier used by FilePath to retain
the existing timestamp prefix while appending a process-unique Guid.NewGuid()
suffix in compact format. Keep the current filename sanitization and
log-directory behavior unchanged.
---
Outside diff comments:
In `@backend/FwLite/LcmDebugger/Program.cs`:
- Around line 23-29: Wrap the scoped lifecycle containing OpenDownloadedProject
and SyncFwHeadlessProject in an application-level try/catch so failures during
project opening or synchronization are captured before escaping. In the catch,
obtain the application logger through ILoggerFactory, persist the exception
details to the run log, and rethrow the original exception; preserve the
existing async scope and disposal behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 418b2039-7009-4194-9b2f-001e4ebb16aa
📒 Files selected for processing (5)
.gitignorebackend/FwLite/LcmDebugger/LcmDebugger.csprojbackend/FwLite/LcmDebugger/Program.csbackend/FwLite/LcmDebugger/RunOutput.csbackend/FwLite/LcmDebugger/Utils.cs
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
[Claude, autonomous]
Each LcmDebugger run now writes
logs/<timestamp>-run.log, and a dry run's records go tologs/<timestamp>-<project>-dry-run-{crdt,fwdata}-records.jsoninstead of the throwaway project copy, where they were deleted along with it. Nothing is pruned, and a failed run logs its exception (unhandled ones only reach stderr, which the file logger never sees).NReco.Logging.Fileis already used by FwLiteWeb and FwLiteMaui with its version pinned centrally, so this only adds a reference to it.