Skip to content

fix: log watched file changes at debug level - #2554

Open
ousamabenyounes wants to merge 2 commits into
php:mainfrom
ousamabenyounes:fix-1443-watch-debug-path
Open

fix: log watched file changes at debug level#2554
ousamabenyounes wants to merge 2 commits into
php:mainfrom
ousamabenyounes:fix-1443-watch-debug-path

Conversation

@ousamabenyounes

Copy link
Copy Markdown
Contributor

Fixes #1443.

Changes

  • Logs each accepted watcher event at debug level with the changed file path.
  • Includes the associated path when the watcher reports one.
  • Keeps the existing reload behavior unchanged.

Test verification (RED -> GREEN)

RED on origin/main plus the new regression test before the implementation:

--- FAIL: TestAcceptedEventLogsChangedPathAtDebugLevel (0.00s)
    pattern_test.go:381:
        Error:       "" does not contain "/path/file.php"
        Test:        TestAcceptedEventLogsChangedPathAtDebugLevel
FAIL
FAIL    github.com/dunglas/frankenphp/internal/watcher    0.005s

GREEN after the fix:

ok      github.com/dunglas/frankenphp/internal/watcher    0.008s

Command used for GREEN: go test ./internal/watcher -count=1 in Docker with the watcher C library installed.

Comment thread internal/watcher/pattern.go Outdated
@ousamabenyounes
ousamabenyounes force-pushed the fix-1443-watch-debug-path branch from 2dd6110 to 07c74a4 Compare July 26, 2026 09:26
@ousamabenyounes

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Addressed the feedback in 07c74a4 by removing the extra log-message/attribute constants and keeping the debug log labels inline with the surrounding style.

Validation: local ./run-ci.sh passed for go test ./internal/watcher -count=1 in Docker with the watcher C library built, and the GitHub check rollup for 07c74a4 is green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watch mode: Log changed file on debug log level

2 participants