Skip to content
This repository has been archived by the owner on Jun 30, 2020. It is now read-only.

Allow using native debug logging in CORS middleware #61

Merged
merged 2 commits into from Dec 8, 2016
Merged

Allow using native debug logging in CORS middleware #61

merged 2 commits into from Dec 8, 2016

Conversation

delolmo
Copy link
Contributor

@delolmo delolmo commented Dec 7, 2016

neomerx/cors-psr7 supports debug mode with a PSR-3 Logger Interface. The proposed changes allow passing such a logger to the object constructor so that logging can take place.

neomerx/cors-psr7 supports debug mode with a PSR-3 Logger Interface. The proposed changes allow passing such a logger to the object constructor so that logging can take place.
@delolmo delolmo changed the title Allow using native debug logging Allow using native debug logging in CORS middleware Dec 7, 2016
@oscarotero
Copy link
Owner

Hey, thank you. Good addition, but I think this option should be passed using a method, instead using the constructor. The general rule is: constructors only accept the most important argument of the middleware: the router instance, whoops instance, cors settings instance, etc. The other optional settings are passed through methods. So I'd do something like this:

$middleware[] = Middleware::cors($settings)
    ->logger($logger);

What do you think? Do you mind make this change?

Logger is now passed through method instead of the constructor.
@delolmo
Copy link
Contributor Author

delolmo commented Dec 8, 2016

Done!

@oscarotero oscarotero merged commit 8afd019 into oscarotero:master Dec 8, 2016
@oscarotero
Copy link
Owner

Good job! Thank you

@delolmo delolmo deleted the patch-1 branch December 8, 2016 10:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants