Seldaek / monolog

Sends your logs to files, sockets, inboxes, databases and various web services
https://seldaek.github.io/monolog/
MIT License
21.02k stars 1.9k forks source link

Provide a Processor interface #540

Closed tremby closed 9 years ago

tremby commented 9 years ago

It would be useful to have an interface which Processor classes implement. They are mostly loose classes with no inheritance right now, so determining that a given object is a Processor is impossible.

stof commented 9 years ago

This would be a BC break, and remove flexibility. Processors are currently any callable. If Monolog was requiring PHP 5.4+, the method adding them would have a callable typehint.

tremby commented 9 years ago

Ah, so all I need to do is run is_callable() on it, and if that's true, which it is if the __invoke method is declared, it can count as a processor. So everything I want to do is already possible. Thanks for clarifying.