Uh oh!
There was an error while loading. Please reload this page.
Add a PSR-3 logger adapter and make it injectable - #18200
Conversation
danopz
commented
Dec 8, 2019
PHP-FIG is currently working on adding types to existing PSRs php-fig/fig-standards#1195 Don't know if there is any plan when it will be there, just wanted to mention that |
ChristophWurst
commented
Dec 9, 2019
Thanks a lot for this info. I wasn't aware of that. Then let's wait a bit until this has settled. |
ChristophWurst
commented
Feb 7, 2020
Still no 2.0 🤷♂️ |
rullzer
commented
Feb 7, 2020
do we want to wait? |
This comment has been minimized.
This comment has been minimized.
109dbb7 to
040cb2eCompareChristophWurst
commented
Feb 7, 2020
Errrrr actually we can't. You can have a broader (super) type as hint, but you can't put |
040cb2e to
e4d3669CompareUh oh!
There was an error while loading. Please reload this page.
e4d3669 to
c80d1bdCompareUh oh!
There was an error while loading. Please reload this page.
c80d1bd to
8fc6618Compare
This comment has been minimized.
This comment has been minimized.
nickvergessen
commented
Feb 7, 2020
Yeah, I was about to say that. our logger is supposed to be compatible. So I'd say we either remove the type hints for now, or we wait until PSR added them? |
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
8fc6618 to
1b4380aCompareChristophWurst
commented
Mar 26, 2020
Still no 2.0, so this won't be typed right now. But we can tighten later as you said. Let's do this :) |
nickvergessen
left a comment
There was a problem hiding this comment.
Fine by me and seems to be additional on top?
Should we ask people to use that instead?
ChristophWurst
commented
Apr 8, 2020
Yes, right now our logging stays untouched.
Let's maybe wait a bit for the typed interface. I hope this lands soon-ish. Then we can advertise the PSR logger more. |
Stumbled over https://www.php-fig.org/psr/psr-3/ because I'm writing a php library that I would like to make Nextcloud-agnostic. To be able to use a logger in the library, I chose to use the PSR-3 standard and inject a tiny adapter.
I figured it would make sense to have this in our code base. This smoothens the integration of 3rd party libraries.
Adding the interface as base of our ILogger is not possible as we have
stringtype hints on the messages, whereas the PSR3 interface only has documented types.