record example

return;
        }

        $formatter = $this->formatter;
        if ($this->handle) {
            @fwrite($this->handle, $formatter($level$message$context).\PHP_EOL);
        } else {
            error_log($formatter($level$message$context, false));
        }

        if ($this->debug && $this->requestStack) {
            $this->record($level$message$context);
        }
    }

    public function getLogs(Request $request = null): array
    {
        if ($request) {
            return $this->logs[spl_object_id($request)] ?? [];
        }

        return array_merge(...array_values($this->logs));
    }

    
$this->traces[$this->getTraceKey($request)] = [];

        if (!$request->isMethodSafe()) {
            $response = $this->invalidate($request$catch);
        } elseif ($request->headers->has('expect') || !$request->isMethodCacheable()) {
            $response = $this->pass($request$catch);
        } elseif ($this->options['allow_reload'] && $request->isNoCache()) {
            /* If allow_reload is configured and the client requests "Cache-Control: no-cache", reload the cache by fetching a fresh response and caching it (if possible). */
            $this->record($request, 'reload');
            $response = $this->fetch($request$catch);
        } else {
            $response = $this->lookup($request$catch);
        }

        $this->restoreResponseBody($request$response);

        if (HttpKernelInterface::MAIN_REQUEST === $type) {
            $this->addTraces($response);
        }

        
return;
        }

        $formatter = $this->formatter;
        if ($this->handle) {
            @fwrite($this->handle, $formatter($level$message$context).\PHP_EOL);
        } else {
            error_log($formatter($level$message$context, false));
        }

        if ($this->debug && $this->requestStack) {
            $this->record($level$message$context);
        }
    }

    public function getLogs(Request $request = null): array
    {
        if ($request) {
            return $this->logs[spl_object_id($request)] ?? [];
        }

        return array_merge(...array_values($this->logs));
    }

    
$this->state->set('drupal.performance_test_recorder', $record);
    }
    else {
      isset(self::$record[$type][$name]) ? self::$record[$type][$name]++ : self::$record[$type][$name] = 1;
    }
  }

  /** * Records a router rebuild. */
  public function onRouteBuilderFinish() {
    $this->record('event', RoutingEvents::FINISHED);
  }

  /** * {@inheritdoc} */
  public static function getSubscribedEvents(): array {
    $events = [];
    $events[RoutingEvents::FINISHED][] = ['onRouteBuilderFinish', -9999999];
    return $events;
  }

  
$this->traces[$this->getTraceKey($request)] = [];

        if (!$request->isMethodSafe()) {
            $response = $this->invalidate($request$catch);
        } elseif ($request->headers->has('expect') || !$request->isMethodCacheable()) {
            $response = $this->pass($request$catch);
        } elseif ($this->options['allow_reload'] && $request->isNoCache()) {
            /* If allow_reload is configured and the client requests "Cache-Control: no-cache", reload the cache by fetching a fresh response and caching it (if possible). */
            $this->record($request, 'reload');
            $response = $this->fetch($request$catch);
        } else {
            $response = $this->lookup($request$catch);
        }

        $this->restoreResponseBody($request$response);

        if (HttpKernelInterface::MAIN_REQUEST === $type) {
            $this->addTraces($response);
        }

        

    function timer(?string $name = null, ?callable $callable = null)
    {
        $timer = Services::timer();

        if (empty($name)) {
            return $timer;
        }

        if ($callable !== null) {
            return $timer->record($name$callable);
        }

        if ($timer->has($name)) {
            return $timer->stop($name);
        }

        return $timer->start($name);
    }
}

if (function_exists('view')) {
    
Home | Imprint | This part of the site doesn't use cookies.