log() публичный Метод

Add a message to the log
public log ( string $message, integer $level = self::NOTICE ) : boolean
$message string The message to log
$level integer The logging level
Результат boolean Whether the messages was logged
Пример #1
0
 /**
  * Invalidate the query cache
  *
  * @return void
  */
 protected function invalidateQueryCache()
 {
     if ($this->queryCache) {
         $this->queryCache->clear();
         $this->logger->log("Query cache invalidated", \Elgg\Logger::INFO);
     }
 }
Пример #2
0
 /**
  * Includes view PHP or static file
  * 
  * @param string $view                 The view name
  * @param array  $vars                 Variables passed to view
  * @param string $viewtype             The viewtype
  * @param bool   $issue_missing_notice Log a notice if the view is missing
  *
  * @return string|false output generated by view file inclusion or false
  */
 private function renderViewFile($view, array $vars, $viewtype, $issue_missing_notice)
 {
     $file = $this->findViewFile($view, $viewtype);
     if (!$file) {
         if ($issue_missing_notice) {
             $this->logger->log("{$viewtype}/{$view} view does not exist.", 'NOTICE');
         }
         return false;
     }
     if (pathinfo($file, PATHINFO_EXTENSION) === 'php') {
         ob_start();
         include $file;
         return ob_get_clean();
     }
     return file_get_contents($file);
 }