/**
  * Generic hook logging facility.
  *
  * @param string $hookName The hook name.
  *
  * @param array  $params   The parameters.
  *
  * @param bool   $starting Flag determining if we are entering the hook or exiting.
  *
  * @return void
  */
 protected function processHook($hookName, $params, $starting)
 {
     if (!$starting) {
         if (self::$timeCollector->hasStartedMeasure($hookName)) {
             self::$timeCollector->stopMeasure($hookName);
         }
         return;
     }
     if (self::$timeCollector && $hookName !== 'initializeSystem') {
         if (!self::$timeCollector->hasStartedMeasure($hookName)) {
             self::$timeCollector->startMeasure($hookName, $hookName);
         }
     }
     $exception = new \ErrorException();
     $stack = $exception->getTrace();
     $information = array('caller' => str_replace(TL_ROOT, 'TL_ROOT', $stack[1]['file']) . '#' . $stack[1]['line'], '$GLOBALS[\'TL_HOOKS\'][\'' . $hookName . '\']' => $this->createHookList($GLOBALS['TL_HOOKS'][$hookName]), 'parameters' => $this->prepareParams($hookName, $params));
     $this->log($information, $hookName);
 }