add logger explicit;cleanup;correct cs
This commit is contained in:
parent
30e3d67cb6
commit
82b82b1908
4 changed files with 10 additions and 4 deletions
10
Client.php
10
Client.php
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle;
|
||||
|
||||
use Elastica_Client;
|
||||
|
|
@ -8,13 +9,18 @@ use Elastica_Client;
|
|||
*/
|
||||
class Client extends Elastica_Client
|
||||
{
|
||||
protected $logger;
|
||||
|
||||
public function setLogger($logger)
|
||||
{
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public function request($path, $method, $data = array()) {
|
||||
$this->logger->logQuery($path, $method, $data);
|
||||
public function request($path, $method, $data = array())
|
||||
{
|
||||
if (null !== $this->logger) {
|
||||
$this->logger->logQuery($path, $method, $data);
|
||||
}
|
||||
|
||||
return parent::request($path, $method, $data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue