Skip to content

[claude] Keep LcmDebugger run output in timestamped log files - #2507

Merged
myieye merged 5 commits into
developfrom
lcm-debugger-run-logs
Jul 30, 2026
Merged

[claude] Keep LcmDebugger run output in timestamped log files#2507
myieye merged 5 commits into
developfrom
lcm-debugger-run-logs

Conversation

@myieye

@myieye myieye commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

[Claude, autonomous]

Each LcmDebugger run now writes logs/<timestamp>-run.log, and a dry run's records go to logs/<timestamp>-<project>-dry-run-{crdt,fwdata}-records.json instead 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.File is already used by FwLiteWeb and FwLiteMaui with its version pinned centrally, so this only adds a reference to it.

myieye and others added 5 commits July 30, 2026 15:27
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>
@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Jul 30, 2026
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

LcmDebugger 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. FwHeadlessProject also includes the project name.

Changes

LcmDebugger output pipeline

Layer / File(s) Summary
File logging foundation
backend/FwLite/LcmDebugger/RunOutput.cs, backend/FwLite/LcmDebugger/LcmDebugger.csproj, backend/FwLite/LcmDebugger/Program.cs, .gitignore
Adds timestamped, sanitized output paths, configures NReco file logging, and ignores generated logs.
Project lifecycle logging
backend/FwLite/LcmDebugger/Utils.cs
Adds the project name to FwHeadlessProject, introduces a named logger, and replaces project initialization console output with structured logging.
Sync and dry-run record output
backend/FwLite/LcmDebugger/Utils.cs
Logs synchronization failures and success, and serializes CRDT and fwdata dry-run records to separate indented JSON files.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: hahn-kev

Poem

I’m a bunny with logs in a neat little row,
Timestamped paths where the run outputs go.
CRDTs and fwdata hop into JSON,
While structured logs sparkle like dew on a lawn.
“Thump-thump!” says the rabbit—“The debugger can grow!”

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: timestamped log files for LcmDebugger run output.
Description check ✅ Passed The description accurately describes the logging and dry-run record file changes in LcmDebugger.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lcm-debugger-run-logs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@myieye myieye added the self-reviewed 👁️ I reviewed this myself and with AI and decided it was safe to merge without a second set of eyes label Jul 30, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Log failures before synchronization starts.

OpenDownloadedProject executes before the catch in SyncFwHeadlessProject, 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 through ILoggerFactory, 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

📥 Commits

Reviewing files that changed from the base of the PR and between a5c216f and fb2e1a9.

📒 Files selected for processing (5)
  • .gitignore
  • backend/FwLite/LcmDebugger/LcmDebugger.csproj
  • backend/FwLite/LcmDebugger/Program.cs
  • backend/FwLite/LcmDebugger/RunOutput.cs
  • backend/FwLite/LcmDebugger/Utils.cs

Comment thread backend/FwLite/LcmDebugger/RunOutput.cs
@argos-ci

argos-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Jul 30, 2026, 3:46 PM
e2e (Inspect) ✅ No changes detected - Jul 30, 2026, 3:53 PM

@myieye
myieye merged commit a425984 into develop Jul 30, 2026
20 checks passed
@myieye
myieye deleted the lcm-debugger-run-logs branch July 30, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related self-reviewed 👁️ I reviewed this myself and with AI and decided it was safe to merge without a second set of eyes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant