php-fig/log — pull request #24 by FlorianWolters (2014-10-18 12:32:17+00:00)
Title: Removed abstract member function `log` from `LoggerTrait`. 

A class using `\Psr\Log\LoggerTrait` should always implement `\Psr\Log\LoggerInterface`. I can not not see a reason why the member function `log` is included in the trait `\Psr\Log\LoggerTrait`. The following should not be written and is forbidden by this PR:

```php
= 5.4.

class ConsoleLogger implements \Psr\Log\LoggerInterface
{
use \Psr\Log\LoggerTrait;

public function log($level, $message, array $context = array())
{
echo $level . ": " . $message . "\n";
}
}

// Example 2: Use abstract base class. Required for PHP < 5.4.

class NullLogger extends \Psr\Log\AbstractLogger
{
public function log($level, $message, array $context = array())
{
// noop
}
}

$message = 'hello, world';
$loggers = array(new ConsoleLogger, new NullLogger);

foreach ($loggers as $logger)
{
$logger->emergency($message);
$logger->alert($message);
$logger->critical($message);
$logger->error($message);
$logger->warning($message);
$logger->info($message);
$logger->notice($message);
$logger->debug($message);
$logger->log(\Psr\Log\LogLevel::DEBUG, $message);
}
```