-
-
Notifications
You must be signed in to change notification settings - Fork 15
Feature/logger #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature/logger #83
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,6 +78,8 @@ final class Page implements PageInterface, EventDispatcherInterface | |
|
|
||
| private PageEventHandlerInterface $eventHandler; | ||
|
|
||
| private LoggerInterface $logger; | ||
|
|
||
| private ?APIRequestContextInterface $apiRequestContext = null; | ||
|
|
||
| private bool $isClosed = false; | ||
|
|
@@ -92,8 +94,10 @@ public function __construct( | |
| private readonly BrowserContextInterface $context, | ||
| private readonly string $pageId, | ||
| private readonly PlaywrightConfig $config, | ||
| private readonly LoggerInterface $logger = new NullLogger(), | ||
| ?LoggerInterface $logger = null, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would remove it from here and use only the one from config, and in confing spawn the null one by default. |
||
| ) { | ||
| $this->logger = $logger ?? $config->logger ?? new NullLogger(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you update doc/docblock on this ? Or do we consider this a bug? |
||
|
|
||
| $this->keyboard = new Keyboard($this->transport, $this->pageId); | ||
| $this->mouse = new Mouse($this->transport, $this->pageId); | ||
| $this->eventHandler = new PageEventHandler(); | ||
|
|
@@ -204,7 +208,7 @@ public function locator(string $selector, array|LocatorOptions $options = []): L | |
| $this->pageId, | ||
| $selector, | ||
| null, | ||
| null, | ||
| $this->logger, | ||
| $this->normalizeLocatorOptions($options) | ||
| ); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe