zendframework / zend-log

Log component from Zend Framework
BSD 3-Clause "New" or "Revised" License
62 stars 51 forks source link

PSR-3 compliants? #35

Closed dlevel closed 8 years ago

dlevel commented 8 years ago

Why does the interface Zend\Log\LoggerInterface does not respect the PSR-3 one?

Ocramius commented 8 years ago

Mostly because it was designed much (MUCH!) earlier than PSR-3

Ocramius commented 8 years ago

PSR-3 compliance is already provided, as documented

dlevel commented 8 years ago

Hi, I've already learned this part of the doc before asking you this question. My question was because the class Zend\Log\Logger does not respect the PSR3 interface.

I'm not able to use the adapter specified in the documentation because I already need to use the Syslog one for my purpose.

I do agree that this module was develop before PSR-3 and that's why I wanted to know if a PR could be accepted for that?

Ocramius commented 8 years ago

Changing interfaces is a major backwards-incompatible change, so we wouldn't be able to change the logger interface anyway (the PR would be rejected)

dlevel commented 8 years ago

Ok I understand that point.

halfpastfouram commented 6 years ago

@Ocramius Couldn't that be resolved by having the Zend\Log\LoggerInterface extend Psr\Log\LoggerInterface or am I missing something?

Ocramius commented 6 years ago

Keep the interfaces and implementations separated: mixing interfaces is just trouble, as you risk starting to couple to both without noticing, and you may have signature collisions.