Logs an entry.

@param array|string $entry

@see AnLog::addEntry options

@return mixed
961822
public function log($entry, $level = LOG_LEVEL_INFO)
    {
        if (!is_array($entry)) {
            $entry = array('comment' => $entry, 'level' => $level);
        }

        $this->_log->addEntry($entry);

        return $this;
    }
406277
private static function isEntryOutOfScope(array $entry)
    {
        if (empty($entry['path']) && $entry['path'] !== '0') {
            return false;
        }

        if (self::$recursive) {
            return self::residesInDirectory($entry);
        }

        return self::isDirectChild($entry);
    }
124788
public static function log($entry, $markName = '...', $params = array())
    {
        if (!self::isDebug()) {
            return false;
        }

        // emulate normal class
        $_this = self::i();

        // check var type
        if (is_bool($entry)) {
            $entry = ($entry) ? 'TRUE' : 'FALSE';
        } elseif (is_null($entry)) {
            $entry = 'NULL';
        } elseif (is_resource($entry)) {
            $entry = 'resource of "' . get_resource_type($entry) . '"';
        }

        // serialize type
        if (self::$_config['log']['serialize'] == 'formats') {
            // don't change log entry

        } elseif (self::$_config['log']['serialize'] == 'none') {
            $entry = array('jbdump_message' => $entry);

        } elseif (self::$_config['log']['serialize'] == 'json') {
            $entry = array('jbdump_message' => @json_encode($entry));

        } elseif (self::$_config['log']['serialize'] == 'serialize') {
            $entry = array('jbdump_message' => serialize($entry));

        } elseif (self::$_config['log']['serialize'] == 'print_r') {
            $entry = array('jbdump_message' => print_r($entry, true));

        } elseif (self::$_config['log']['serialize'] == 'php_array') {
            $markName = (empty($markName) || $markName == '...') ? 'dumpVar' : $markName;
            $entry    = array('jbdump_message' => JBDump_array2php::toString($entry, $markName));

        } elseif (self::$_config['log']['serialize'] == 'var_dump') {
            ob_start();
            var_dump($entry);
            $entry = ob_get_clean();
            $entry = array('jbdump_message' => var_dump($entry, true));
        }

        if (isset($params['trace'])) {
            $_this->_trace = $params['trace'];
        } else {
            $_this->_trace = debug_backtrace();
        }

        $entry['name']      = $markName;
        $entry['datetime']  = date(self::DATE_FORMAT);
        $entry['client_ip'] = self::getClientIP();
        $entry['file']      = $_this->_getSourcePath($_this->_trace, true);
        $entry              = array_change_key_case($entry, CASE_UPPER);

        $fields = array();
        $format = isset($params['format']) ? $params['format'] : self::$_config['log']['format'];
        preg_match_all("/{(.*?)}/i", $format, $fields);

        // Fill in the field data
        $line = $format;
        for ($i = 0; $i < count($fields[0]); $i++) {
            $line = str_replace($fields[0][$i], (isset ($entry[$fields[1][$i]])) ? $entry[$fields[1][$i]] : "-", $line);
        }

        // Write the log entry line
        if ($_this->_openLog()) {
            error_log($line . PHP_EOL, 3, $_this->_logfile);
        }

        return $_this;
    }
773263
private function residesInDirectory(array $entry)
    {
        if ($this->directory === '') {
            return true;
        }

        return $this->caseSensitive
            ? strpos($entry['path'], $this->directory . '/') === 0
            : stripos($entry['path'], $this->directory . '/') === 0;
    }
281776
public function findNextEntry(Entry $entry) {
    $list = $this->findAfter($entry, 1);

    if (count($list) === 1) {
      return current($list);
    }

    return NULL;
  }
75369
public function addEntry(LogEntry $entry)
	{
		// Generate the value for the priority based on predefined constants.
		$priority = constant(strtoupper('LOG_' . $this->priorities[$entry->priority]));

		// Send the entry to Syslog.
		syslog($priority, '[' . $entry->category . '] ' . $entry->message);
	}
130359
protected function parseEntry($entry)
    {
        if (!get_property($entry, 'url')) {
            throw new \InvalidArgumentException('Url is missing or not accessible.');
        }
        $url        = get_property($entry, 'url');
        $lastmod    = get_property($entry, 'lastmod');
        $changefreq = get_property($entry, 'changefreq');
        $priority   = get_property($entry, 'priority');

        return [$url, $lastmod, $changefreq, $priority];
    }
580496
protected function writeToLog($entry) {
		if ($entry[0] >= $this->logLevel) {
			trigger_error("** ".$this->getFormattedCaller()." ** {$entry[1]} **",$this->loggerTypes[$entry[0]]->getPhpErrorCode());
		}
	}
742365
public function log(array $log)
    {
        if (null !== $this->config->getLoggerCallable()) {
            call_user_func($this->config->getLoggerCallable(), $log);
        }
    }
982739
public function get($entry)
    {
        $value = false;

        foreach ($this->caches as $cache) {
            $value = $cache->get($entry);
            if ($value !== false) {
                return $value;
            }
        }
        return $value;
    }
735767
protected function eventLogger($event)
    {
        switch ($event->name) {
            case 'afterInsert':
                return Log::add(1, ['tableName' => 'cms_nav_item', 'action' => 'insert', 'row' => $this->id], 'cms_nav_item', $this->id, $this->toArray());
            case 'afterUpdate':
                return Log::add(2, ['tableName' => 'cms_nav_item', 'action' => 'update', 'row' => $this->id], 'cms_nav_item', $this->id, $this->toArray());
            case 'afterDelete':
                return Log::add(3, ['tableName' => 'cms_nav_item', 'action' => 'delete', 'row' => $this->id], 'cms_nav_item', $this->id, $this->toArray());
        }
    }
558486
public function insertSliderType($entry) {
        $return_value = $this->connection->insert('site_sliders_types')
                ->fields($entry)
                ->execute();

        return $return_value;
    }
438436
public function serialize(Entry $entry, array $options = [])
    {
        $user = $entry->getUser();

        $serialized = [
            'id' => $entry->getUuid(),
            'autoId' => $entry->getId(),
            'title' => $entry->getTitle(),
            'status' => $entry->getStatus(),
            'locked' => $entry->isLocked(),
            'creationDate' => $entry->getCreationDate() ? $entry->getCreationDate()->format('Y-m-d H:i:s') : null,
            'editionDate' => $entry->getEditionDate() ? $entry->getEditionDate()->format('Y-m-d H:i:s') : null,
            'publicationDate' => $entry->getPublicationDate() ? $entry->getPublicationDate()->format('Y-m-d H:i:s') : null,
            'user' => $user ? $this->userSerializer->serialize($user, [Options::SERIALIZE_MINIMAL]) : null,
            'clacoForm' => [
                'id' => $entry->getClacoForm()->getUuid(),
            ],
        ];
        $fieldValues = $entry->getFieldValues();

        if (count($fieldValues) > 0) {
            $serialized['values'] = $this->serializeValues($fieldValues);
        }
        if (!in_array(Options::SERIALIZE_MINIMAL, $options)) {
            $serialized = array_merge($serialized, [
                'categories' => $this->getCategories($entry),
                'keywords' => $this->getKeywords($entry),
                'comments' => $this->getComments($entry),
            ]);
        }

        return $serialized;
    }
984978
private function buildPostFromRegisterEntry($filename, RegisterEntry $entry)
    {
        $filepath = $this->postsDirectory . $filename;

        if (null !== $entry->getPublishDate()) {
            $publishDate = $entry->getPublishDate();
        } else {
            $publishDate = $this->computeFilePublishDate($filepath);
        }

        if (null !== $entry->getAlias()) {
            $name = $entry->getAlias();
        } else {
            $name = basename($filename, '.md');
        }

        if ($entry->getBlogType() === Post::TYPE_EXTERNAL) {
            $post = new ExternalPost(
                $filepath,
                $name,
                $publishDate,
                $entry->getCategory(),
                $entry->getTags(),
                $entry->getUrl()
            );
        } else {
            $post = new Post(
                $filepath,
                $name,
                $publishDate,
                $entry->getCategory(),
                $entry->getTags()
            );
        }

        return $post;
    }
655073
public function addEntry(LogEntry $entry)
	{
		// Initialise the file if not already done.
		if (!is_resource($this->file))
		{
			$this->initFile();
		}

		// Set some default field values if not already set.
		if (!isset($entry->clientIP))
		{
			// Check for proxies as well.
			if (isset($_SERVER['REMOTE_ADDR']))
			{
				$entry->clientIP = $_SERVER['REMOTE_ADDR'];
			}
			elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
			{
				$entry->clientIP = $_SERVER['HTTP_X_FORWARDED_FOR'];
			}
			elseif (isset($_SERVER['HTTP_CLIENT_IP']))
			{
				$entry->clientIP = $_SERVER['HTTP_CLIENT_IP'];
			}
		}

		// If the time field is missing or the date field isn't only the date we need to rework it.
		if ((strlen($entry->date) != 10) || !isset($entry->time))
		{
			// Get the date and time strings in GMT.
			$entry->datetime = $entry->date->toISO8601();
			$entry->time = $entry->date->format('H:i:s', false);
			$entry->date = $entry->date->format('Y-m-d', false);
		}

		// Get a list of all the entry keys and make sure they are upper case.
		$tmp = array_change_key_case(get_object_vars($entry), CASE_UPPER);

		// Decode the entry priority into an English string.
		$tmp['PRIORITY'] = $this->priorities[$entry->priority];

		// Fill in field data for the line.
		$line = $this->format;

		foreach ($this->fields as $field)
		{
			$line = str_replace('{' . $field . '}', (isset($tmp[$field])) ? $tmp[$field] : '-', $line);
		}

		// Write the new entry to the file.
		if (!fwrite($this->file, $line . "\n"))
		{
			throw new \RuntimeException('Cannot write to log file.');
		}
	}
1303369
public function addEntry(AbstractEntry $entry, $prepend = false) {
        if ($prepend) {
            array_unshift($this->entries, $entry);
        } else {
            $this->entries[] = $entry;
        }
    }
759743
public static function getDateModified(Entry $entry)
    {
        $dateModified = $entry->getDateModified();
        if (!empty($dateModified)) {
            return Core::make('helper/date')->formatDateTime($dateModified);
        } else {
            return Core::make('helper/date')->formatDateTime($entry->getDateCreated());
        }

    }