ppi / framework

The PPI Framework Engine
http://www.ppi.io
MIT License
154 stars 30 forks source link

Bug/non existent logger service #118

Closed garyttierney closed 9 years ago

garyttierney commented 9 years ago

Given that the framework shouldn't be responsible for creating and managing a Logger for the entire application, we needed a way to prevent any code which depended on the 'Logger' service being available from throwing fatal errors.

This PR addresses this problem by creating a proxy class which overrides the __call() magic method to automatically forward log invocations through to the underlying implementation. The LoggerProxy class itself also inherits from Psr\Log\LoggerInterface, which prevents type-hinting and instanceof checks from breaking.

vitorbrandao commented 9 years ago

Thanks @garyttierney!