Returns decorated log messages.

@param array $log
@return array|Output\Format\FormatInterface
962780
public function getDecoratedMessages(array $log = null)
    {
        if (true === empty($log)) {
            return array();
        }

        return $this->decorator->setLog($log)
            ->setIssueTrackerUrlPattern($this->config['issue_tracker_pattern'])
            ->decorate();
    }
230210
public function formatLog(array $logMessage) {
        extract($logMessage);

        $level = strtoupper($level);
        $message = $this->applyContext($message, $context);
        $timestamp = date($this->dateTimeFormat, $timestamp);
        $exception = $this->getExceptionTrace($context);

        $log = str_replace(self::FORMAT_TIMESTAMP, $timestamp, $this->logFormat);
        $log = str_replace(self::FORMAT_LEVEL, $level, $log);
        $log = str_replace(self::FORMAT_MESSAGE, $message, $log);
        $log = str_replace(self::FORMAT_EXCEPTION, $exception, $log);

        return $log;
    }
90987
protected function _reportSpecMessage($log)
    {
        $messages = $log->messages();
        $message = end($messages);

        switch ($log->type()) {
            case 'passed':
                $this->write($this->_symbols['ok'], 'light-green');
                $this->write(' ');
                $this->write("{$message}\n", 'dark-grey');
                break;
            case 'skipped':
                $this->write($this->_symbols['ok'], 'light-grey');
                $this->write(' ');
                $this->write("{$message}\n", 'light-grey');
                break;
            case 'pending':
                $this->write($this->_symbols['ok'], 'cyan');
                $this->write(' ');
                $this->write("{$message}\n", 'cyan');
                break;
            case 'excluded':
                $this->write($this->_symbols['ok'], 'yellow');
                $this->write(' ');
                $this->write("{$message}\n", 'yellow');
                break;
            case 'failed':
                $this->write($this->_symbols['err'], 'red');
                $this->write(' ');
                $this->write("{$message}\n", 'red');
                break;
            case 'errored':
                $this->write($this->_symbols['err'], 'red');
                $this->write(' ');
                $this->write("{$message}\n", 'red');
                break;
        }
    }
1275913
public static function hydrateCollection(array $logs)
    {
        $hydrated = [];

        foreach ($logs as $log) {
            $hydrated[] = self::hydrate($log);
        }

        return $hydrated;
    }
894414
protected function displaySummary($logs)
	{
		$stack=array();
		$results=array();
		foreach($logs as $log)
		{
			if($log[1]!==CLogger::LEVEL_PROFILE)
				continue;
			$message=$log[0];
			if(!strncasecmp($message,'begin:',6))
			{
				$log[0]=substr($message,6);
				$stack[]=$log;
			}
			elseif(!strncasecmp($message,'end:',4))
			{
				$token=substr($message,4);
				if(($last=array_pop($stack))!==null && $last[0]===$token)
				{
					$delta=$log[3]-$last[3];
					if(!$this->groupByToken)
						$token=$log[2];
					if(isset($results[$token]))
						$results[$token]=$this->aggregateResult($results[$token],$delta);
					else
						$results[$token]=array($token,1,$delta,$delta,$delta);
				}
				else
					throw new CException(Yii::t('yii','CProfileLogRoute found a mismatching code block "{token}". Make sure the calls to Yii::beginProfile() and Yii::endProfile() be properly nested.',
						array('{token}'=>$token)));
			}
		}

		$now=microtime(true);
		while(($last=array_pop($stack))!==null)
		{
			$delta=$now-$last[3];
			$token=$this->groupByToken ? $last[0] : $last[2];
			if(isset($results[$token]))
				$results[$token]=$this->aggregateResult($results[$token],$delta);
			else
				$results[$token]=array($token,1,$delta,$delta,$delta);
		}

		$entries=array_values($results);
		usort($entries, array($this, 'resultEntryCompare'));

		$this->render('profile-summary',$entries);
	}
690709
protected function getOutputRecord(array $record)
    {
        // Adds the basic log details.
        $output = [
            static::DATETIME_OFFSET => $record['datetime']->format(static::DATETIME_FORMAT),
            static::SEVERITY_OFFSET => $record['level_name'],
            static::CONTENT_OFFSET  => $record['message'],
        ];

        // Adds the context file.
        if (isset($record['context']['file'])) {
            $output[static::FILE_OFFSET] = $record['context']['file'];
        }

        // Adds the context line.
        if (isset($record['context']['line'])) {
            $output[static::LINE_OFFSET] = $record['context']['line'];
        }

        // Adds the stack information.
        if (isset($record['extra'][EnvironmentProcessorAbstract::LOG_STACK])) {
            $output[static::STACK_OFFSET] = $record['extra'][EnvironmentProcessorAbstract::LOG_STACK];
        }

        // Adds the trace information.
        if (isset($record['extra'][BacktraceProcessor::TRACE_OFFSET])) {
            $output[static::TRACE_OFFSET] = $record['extra'][BacktraceProcessor::TRACE_OFFSET];
        }

        return $output;
    }
201318
protected function errorLogs(array $collection)
    {
        $return = [
            'total_logs_count' => count($collection)
        ];
        $item   = [];
        foreach ($collection as $row) {
            $row  = array_except($row, 'date');
            $keys = array_keys($row);
            if (empty($item)) {
                $item = array_fill_keys($keys, 0);
            }
            foreach ($keys as $key) {
                $item[$key] += $row[$key];
            }
        }
        return $return + $item;
    }
1334827
protected function getLogPath($log)
    {

        $dir = $this->log_root.'/'.$log.'/';

        if(!is_dir($dir)){
            mkdir($dir, 0777, true);
        }

        return $dir;
    }
720515
protected function formatMessage($message)
    {
        if (is_array($message)) {
            $message = var_export($message, true);
        } elseif (is_object($message)) {
            $message = get_object_vars($message);
        }

        return $message;
    }
909287
protected function formatMessage( LogMessage $message )
    {
        return $this->macro_processor->addHandler(
            function($keyword) use($message){
                switch($keyword){
                    case 'LEVEL':
                        return $message->getLevel();
                    case 'TAG':
                        return $message->getTag();
                    case 'MESSAGE':
                        return $this->convertEncoding( $message->getMessage() );
                    case 'FILE':
                    case 'FILENAME':
                        return $message->getFile();
                    case 'LINE':
                        return $message->getLine();
                }
                return null;
            }
        )->process($this->log_format);
    }
1195886
public function specEnd($log = null)
    {
        $isOk = $log->passed() ? "ok" : "not ok";

        switch ($log->type()) {
            case 'skipped':
            case 'pending':
            case 'excluded':
                $prefix = "# {$log->type()} ";
                break;
            default:
                $prefix = '- ';
                break;
        }
        $message = $prefix . trim(implode(" ", $log->messages()));
        $this->_counter++;

        $this->write("{$isOk} {$this->_counter} {$message}\n");

        if ($exception = $log->exception()) {
            $this->write('# Exception: `' . get_class($exception) .'` Code(' . $exception->getCode() . '):' . "\n");
            $this->write('# Message: ' . $exception->getMessage() . "\n");
        } else {
            foreach ($log->children() as $log) {
                if ($log->passed()) {
                    continue;
                }
                $toString = function ($instance) {
                    return 'an instance of `' . get_class($instance) . '`';
                };
                foreach ($log->data() as $key => $value) {
                    $key = ucfirst($key);
                    $value = Text::toString($value, ['object' => ['method' => $toString]]);
                    $this->write("# {$key}: {$value}\n");
                }
            }
        }
    }
388094
public function log(array $log)
    {
        $log['db'] = $this->database->getName();
        $log['collection'] = $this->getName();
        call_user_func_array($this->loggerCallable, array($log));
    }
746385
public function getLog($slug)
    {
        foreach ($this->logs as $log) {
            if ($log->getSlug() == $slug) {
                return $log;
            }
        }
    }
1107520
public function parse(string $log)
    {
        preg_match($this->pattern, $log, $data);

        if (!isset($data['date'])) {
            return null;
        }

        return new LogLine($data);
    }
851619
private function formatContext(array $record)
    {
        $context = $this->filterVariablesUsedAsPlaceholders($record['message'], $record['context']);
        $context = $this->formatDateTimeObjects($context);
        $context = $this->formatThrowableObjects($context);

        $contextAsString = Yaml::dump($context, $this->getInlineLevel($record), $this->prefixLength, Yaml::DUMP_OBJECT);

        if (substr($contextAsString, strpos($contextAsString, self::PHP_SERIALIZED_OBJECT_PREFIX), strlen(self::PHP_SERIALIZED_OBJECT_PREFIX)) === self::PHP_SERIALIZED_OBJECT_PREFIX) {
            $contextAsString = $this->formatSerializedObject($contextAsString);
        }

        $contextAsString = $this->formatTextBlock($contextAsString, '--> ');
        $contextAsString = rtrim($contextAsString, PHP_EOL);

        return $contextAsString;
    }
669044
public function log(array $log)
    {
        if (null !== $this->config->getLoggerCallable()) {
            call_user_func_array($this->config->getLoggerCallable(), array($log));
        }
    }
480076
public function decorate()
    {
        foreach ($this->log as &$entries) {
            array_walk($entries, array($this, 'injectLinks'));
        }

        return $this->log;
    }