joomla/joomla-framework — pull request #262 by dongilbert (2013-10-28 18:46:08+00:00)
Title: RFC: NullLogger

PSR-3 (the logging interface) comes prepackagee with a `NullLogger` that allows us to reduce a log of our check code around the usage of a logger. Currently (although inconsistent) most places use something like this:

```php
if ($this->hasLogger())
{
$this->getLogger()->log('some message');
}
```
Using a `NullLogger`, we can reduce this to a single line:
```php
$this->getLogger()->log('some message');
```
The `getLogger` method has been modified return a `NullLogger` if `$this->logger` is not set or if it's not an `instanceof Psr\Log\LoggerInterface`.

Being that this is an RFC, I wanted to get some feedback on it before implementing it everywhere else we use a logger. Please :+1: or :-1: your opinion on the matter and whether or not you think we should use this approach.