diff --git a/Client.php b/Client.php index 27cff7f..517fa8b 100644 --- a/Client.php +++ b/Client.php @@ -7,6 +7,8 @@ use Elastica\Request; use FOS\ElasticaBundle\Logger\ElasticaLogger; +use PSR\Log\LoggerInterface; + /** * @author Gordon Franke */ @@ -17,7 +19,7 @@ class Client extends ElasticaClient */ protected $logger; - public function setLogger(ElasticaLogger $logger) + public function setLogger(LoggerInterface $logger) { $this->logger = $logger; } diff --git a/Logger/ElasticaLogger.php b/Logger/ElasticaLogger.php index e8840da..1705d06 100644 --- a/Logger/ElasticaLogger.php +++ b/Logger/ElasticaLogger.php @@ -2,7 +2,7 @@ namespace FOS\ElasticaBundle\Logger; -use Symfony\Component\HttpKernel\Log\LoggerInterface; +use Psr\Log\LoggerInterface; /** * Logger for the Elastica. @@ -12,7 +12,7 @@ use Symfony\Component\HttpKernel\Log\LoggerInterface; * * @author Gordon Franke */ -class ElasticaLogger +class ElasticaLogger implements LoggerInterface { protected $logger; protected $queries; @@ -75,4 +75,76 @@ class ElasticaLogger { return $this->queries; } + + /** + * {@inheritdoc} + */ + public function emergency($message, array $context = array()) + { + return $this->logger->emergency($message, $context); + } + + /** + * {@inheritdoc} + */ + public function alert($message, array $context = array()) + { + return $this->logger->alert($message, $context); + } + + /** + * {@inheritdoc} + */ + public function critical($message, array $context = array()) + { + return $this->logger->critical($message, $context); + } + + /** + * {@inheritdoc} + */ + public function error($message, array $context = array()) + { + return $this->logger->error($message, $context); + } + + /** + * {@inheritdoc} + */ + public function warning($message, array $context = array()) + { + return $this->logger->warning($message, $context); + } + + /** + * {@inheritdoc} + */ + public function notice($message, array $context = array()) + { + return $this->logger->notice($message, $context); + } + + /** + * {@inheritdoc} + */ + public function info($message, array $context = array()) + { + return $this->logger->info($message, $context); + } + + /** + * {@inheritdoc} + */ + public function debug($message, array $context = array()) + { + return $this->logger->debug($message, $context); + } + + /** + * {@inheritdoc} + */ + public function log($level, $message, array $context = array()) + { + return $this->logger->log($message, $context); + } }