Exemple #1
0
 /**
  * @param LogEvent $event
  */
 public function logQuery(LogEvent $event)
 {
     $executionTime = microtime(true) - $event->getStart();
     $event->setExecutionTime($executionTime);
     $this->logs->enqueue($event);
 }
 /**
  * @param LogEvent $event
  */
 public static function serialize(LogEvent $event)
 {
     $event->setFilters(self::prepareUnserializableData($event->getFilters()));
     $event->setData(self::prepareUnserializableData($event->getData()));
     $event->setOptions(self::prepareUnserializableData($event->getOptions()));
 }
Exemple #3
0
 /**
  * @param string $method
  * @param array|object  $filters
  * @param array|object  $data
  * @param array  $options
  *
  * @return LogEvent
  */
 private function startQueryLogging(string $method, $filters = null, $data = null, array $options) : LogEvent
 {
     $debugInfo = $this->__debugInfo();
     $event = new LogEvent();
     $event->setFilters($filters);
     $event->setData($data);
     $event->setOptions($options);
     $event->setMethod($method);
     $event->setCollection($debugInfo['collectionName']);
     $this->logger->startLogging($event);
     return $event;
 }