39 lines
739 B
PHP
39 lines
739 B
PHP
<?php
|
|
|
|
/**
|
|
* This file is part of the KnpDoctrineBehaviors package.
|
|
*
|
|
* (c) KnpLabs <http://knplabs.com/>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Knp\DoctrineBehaviors\ORM\Loggable;
|
|
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
/**
|
|
* LoggerCallable can be invoked to log messages using symfony2 logger
|
|
*/
|
|
class LoggerCallable
|
|
{
|
|
/**
|
|
* @var LoggerInterface
|
|
*/
|
|
private $logger;
|
|
|
|
/**
|
|
* @param LoggerInterface $logger
|
|
*/
|
|
public function __construct(LoggerInterface $logger)
|
|
{
|
|
$this->logger = $logger;
|
|
}
|
|
|
|
public function __invoke($message)
|
|
{
|
|
$this->logger->debug($message);
|
|
}
|
|
}
|