ElasticaLogger cleanup
This commit is contained in:
parent
c8c72f5f0b
commit
2b04f6cf34
|
@ -14,32 +14,42 @@ use Psr\Log\LoggerInterface;
|
||||||
*/
|
*/
|
||||||
class ElasticaLogger implements LoggerInterface
|
class ElasticaLogger implements LoggerInterface
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @var LoggerInterface
|
||||||
|
*/
|
||||||
protected $logger;
|
protected $logger;
|
||||||
protected $queries;
|
|
||||||
|
/**
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $queries = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var boolean
|
||||||
|
*/
|
||||||
protected $debug;
|
protected $debug;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param LoggerInterface|null $logger The Symfony logger
|
* @param LoggerInterface|null $logger The Symfony logger
|
||||||
* @param bool $debug
|
* @param boolean $debug
|
||||||
*/
|
*/
|
||||||
public function __construct(LoggerInterface $logger = null, $debug = false)
|
public function __construct(LoggerInterface $logger = null, $debug = false)
|
||||||
{
|
{
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
$this->queries = array();
|
|
||||||
$this->debug = $debug;
|
$this->debug = $debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs a query.
|
* Logs a query.
|
||||||
*
|
*
|
||||||
* @param string $path Path to call
|
* @param string $path Path to call
|
||||||
* @param string $method Rest method to use (GET, POST, DELETE, PUT)
|
* @param string $method Rest method to use (GET, POST, DELETE, PUT)
|
||||||
* @param array $data arguments
|
* @param array $data Arguments
|
||||||
* @param float $time execution time
|
* @param float $time Execution time
|
||||||
* @param array $connection host, port and transport of the query
|
* @param array $connection Host, port and transport of the query
|
||||||
* @param array $query arguments
|
* @param array $query Arguments
|
||||||
*/
|
*/
|
||||||
public function logQuery($path, $method, $data, $time, $connection = array(), $query = array())
|
public function logQuery($path, $method, $data, $time, $connection = array(), $query = array())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue