Repository navigation
fix(macos): follow the log by name in dev-run.sh --log - #22
Open
PCcoding666 wants to merge 1 commit into
Open
PCcoding666 wants to merge 1 commit into
PCcoding666 wants to merge 1 commit into
Conversation
The app recreates ~/Library/Logs/LCTMac.log with FileManager.createFile(atPath:contents:) in applicationDidFinishLaunching, which replaces the file with a new inode. That usually happens after dev-run.sh has already started `tail -f`, so tail kept following the old, deleted file and --log never showed the new run's lines. Use `tail -F`, which reopens the path when the file is replaced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Scripts/dev-run.sh --lognever shows the new run's log lines.At launch, the app recreates
~/Library/Logs/LCTMac.logwithFileManager.createFile(atPath:contents:)inapplicationDidFinishLaunching. That call replaces the file with a new inode.dev-run.shstartstail -fright afteropen, before the app has finished launching. Sotail -fkeeps following the old, deleted file: it prints the previous run's tail and then nothing.Change
--lognow runstail -F, which follows the path and reopens it when the file is replaced. The usage comment is updated too.Test plan
createFile(atPath:contents: nil)on an existing file, the inode changed (90844092→90844094);tail -fprinted only the old line, whiletail -Falso printed the new one.DevRunTests.testDevRun_Log_FollowsLogFileByNameuses a stubbedtailand asserts that--logrunstail -Fon the log path. It fails against the old script.cd macos && ./Scripts/run_tests.sh: debug, release and-warnings-as-errorsbuilds pass, and all 523 tests pass with 0 failures.🤖 Generated with Claude Code