Skip to content

Feature/logger#83

Open
gimler wants to merge 2 commits intoplaywright-php:mainfrom
gimler:feature/logger
Open

Feature/logger#83
gimler wants to merge 2 commits intoplaywright-php:mainfrom
gimler:feature/logger

Conversation

@gimler
Copy link
Contributor

@gimler gimler commented Mar 5, 2026

When i set a logger with PlaywrightConfig my expection is that is used also in Page and locator.

$log = new Logger('stdout');
$log->pushHandler(new StreamHandler('php://stdout', Logger::DEBUG));

$playwrightConfig = new PlaywrightConfig(
    logger: $log,
);
$playwright = PlaywrightFactory::create($playwrightConfig);

before

[05-Mar-2026 09:31:31 Europe/Berlin] PHP Fatal error:  Uncaught Playwright\Exception\TimeoutException: Element not actionable (timeout: 30000ms) in /var/www/sap_et/vendor/playwright-php/playwright/src/Locator/Locator.php:666

now i see in my log

[2026-03-05T09:31:22.553611+01:00] stdout.DEBUG: Navigating to URL {"url":"https://host.local/","options":[]} []
[2026-03-05T09:31:23.210677+01:00] stdout.INFO: Successfully navigated to URL {"url":"https://host.local/"} []
[2026-03-05T09:31:26.109054+01:00] stdout.ERROR: locator.isVisible: Error: strict mode violation: locator('button') resolved to 2 elements:     1) ...
[05-Mar-2026 09:31:31 Europe/Berlin] PHP Fatal error:  Uncaught Playwright\Exception\TimeoutException: Element not actionable (timeout: 30000ms) in /var/www/sap_et/vendor/playwright-php/playwright/src/Locator/Locator.php:666

@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Locator/Locator.php 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

1 participant