Formats the log record as a string.

@param IRecord $record the log record

@filter ON_FORMAT_FILTER(2)

@throws LogException if record is of the wrong type

@return string the formatted log HTML
332004
public function format( IRecord $record )
    {
        if ( !$record instanceof MailLogRecord )
        {
            throw new LogException( 'Record must be an instance of MailLogRecord' );
        }

        $title   = $record->getTitle();
        $heading = $record->getHeading();
        $body    = $record->getBody();

        $html =
            "<html>
                <head>
                    <title>$title</title>
                </head>
                <body>
                    <h1>$title</h1>
                    <h5>$heading</h5>
                    <p>$body</p>
                </body>
            </html>";

        return $html;
    }
592229
@Override
	public synchronized String format(LogRecord record) {
        // clear string builder content of previous runs
        BUILDER.setLength(0);

        // build log message
        appendDateTime(record);
        appendApplication();
        appendLevel(record);
        appendClass(record);
        appendMessage(record);
        appendThrowable(record);
        appendNewLine();

        return BUILDER.toString();
    }
811854
public String formatRecord(RepositoryLogRecord record) {
        if (null == record) {
            throw new IllegalArgumentException("Record cannot be null");
        }
        return formatRecord(record, (Locale) null);
    }
1020462
def format (self, record):
        """"""
        record.hostname = self.hostname
        return logging.Formatter.format(self, record)
163658
protected function processChildRecord($record)
    {
        $id = (int)$record['uid'];
        $this->checkOptions($record);
        /* @var $recordContentObjectRenderer ContentObjectRenderer */
        $recordContentObjectRenderer = GeneralUtility::makeInstance(ContentObjectRenderer::class);
        $recordContentObjectRenderer->start($record, 'tt_content');
        $this->processedRecordVariables[$id] = ['data' => $record];
        if (
            (int)$this->options['recursive'] > 0 &&
            $record['CType'] === 'gridelements_pi1' &&
            !empty($record['tx_gridelements_backend_layout'])
        ) {
            $childProcessorConfiguration = $this->containerProcessorConfiguration;
            $childProcessorConfiguration['dataProcessing.']['0.'] = $this->processorConfiguration;
            $childProcessorConfiguration['dataProcessing.']['0.']['recursive'] = (int)$this->options['recursive'] - 1;
            $childProcessorConfiguration['dataProcessing.']['0'] = 'GridElementsTeam\Gridelements\DataProcessing\GridChildrenProcessor';
            $this->processedRecordVariables[$id] = $this->contentDataProcessor->process(
                $recordContentObjectRenderer,
                $childProcessorConfiguration,
                $this->processedRecordVariables[$id]
            );
        } else {
            $this->processedRecordVariables[$id] = $this->contentDataProcessor->process(
                $recordContentObjectRenderer,
                $this->containerProcessorConfiguration,
                $this->processedRecordVariables[$id]
            );
        }
    }
786483
private function processRouteMatchLogRecord(array $record)
    {
        if ($this->isAsseticLog($record)) {
            $record['message'] = '{method}: {request_uri}';

            return $record;
        }

        $context = $record['context'];

        unset($context['method']);
        unset($context['request_uri']);

        $record['context'] = array_merge(
            array($record['context']['method'] => $record['context']['request_uri']),
            $context
        );

        return $record;
    }
1106564
public function getRecordUrl($record)
    {
        if (isset($this->recordOnClick)) {
            return 'javascript:;';
        }

        if (!isset($this->recordUrl)) {
            return null;
        }

        $url = RouterHelper::replaceParameters($record, $this->recordUrl);
        return Backend::url($url);
    }
541949
protected function processFormat(array $record, string $tag): string
    {
        if (preg_match_all('/\{\{(.*?)\}\}/', $tag, $matches)) {
            foreach ($matches[1] as $match) {
                if (!isset($record[$match])) {
                    throw new \LogicException('No such field in the record');
                }
                $tag = str_replace(sprintf('{{%s}}', $match), $record[$match], $tag);
            }
        }

        return $tag;
    }
1204829
@Override
    public synchronized String format(LogRecord record) {
        StringBuilder sb = new StringBuilder();

        ZonedDateTime timestamp = ZonedDateTime.ofInstant(
                Instant.ofEpochMilli(record.getMillis()),
                ZoneId.systemDefault());

        sb.append(formatter.format(timestamp));
        sb.append(" | ");//$NON-NLS-1$

        if (record.getSourceClassName() != null) {
            sb.append(truncate(
                    record.getSourceClassName().substring(
                            record.getSourceClassName().lastIndexOf('.') + 1),
                    30));
        } else {
            sb.append(truncate(record.getLoggerName(), 10));
        }

        sb.append(" | "); //$NON-NLS-1$

        if (record.getSourceMethodName() != null) {
            sb.append(truncate(record.getSourceMethodName(), 30));
        }

        sb.append(" | "); //$NON-NLS-1$

        String message = formatMessage(record);
        sb.append(truncate(record.getLevel().getLocalizedName(), MAX_LEVEL_SIZE));

        sb.append(" | ");//$NON-NLS-1$

        sb.append(message);

        sb.append(System.getProperty("line.separator")); //$NON-NLS-1$
        if (record.getThrown() != null) {
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);
            record.getThrown().printStackTrace(pw);
            pw.close();
            sb.append(sw.toString());
        }
        return sb.toString();
    }
308333
public function formatBatch(array $records)
    {
        $logBatch = array('formatted' => '');

        // ignore the logs related to the web debug toolbar
        if ($this->isWebDebugToolbarLog($records)) {
            return $logBatch;
        }

        $logBatch['formatted'] .= $this->formatLogBatchHeader($records);

        foreach ($records as $key => $record) {
            if ($this->isDeprecationLog($record)) {
                $records[$key] = $this->processDeprecationLogRecord($record);
            }

            if ($this->isEventStopLog($record)) {
                $records[$key] = $this->processEventStopLogRecord($record);
            }

            if ($this->isEventNotificationLog($record)) {
                $records[$key] = $this->processEventNotificationLogRecord($records, $key);
            }

            if ($this->isTranslationLog($record)) {
                $records[$key] = $this->processTranslationLogRecord($records, $key);
            }

            if ($this->isRouteMatchLog($record)) {
                $records[$key] = $this->processRouteMatchLogRecord($record);
            }

            if ($this->isDoctrineLog($record)) {
                $records[$key] = $this->processDoctrineLogRecord($record);
            }

            $logBatch['formatted'] .= rtrim($this->formatRecord($records, $key), PHP_EOL).PHP_EOL;
        }

        $logBatch['formatted'] .= PHP_EOL.PHP_EOL;

        return $logBatch;
    }
479291
@Override
    public String formatMessage(LogRecord logRecord) {
        if (System.getSecurityManager() == null) {
            return formatMessage(logRecord, logRecord.getParameters(), true);
        } else {
            final LogRecord f_logRecord = logRecord;
            return AccessController.doPrivileged(new PrivilegedAction<String>() {
                @Override
                public String run() {
                    return formatMessage(f_logRecord, f_logRecord.getParameters(), true);
                }
            });
        }

    }
1103485
public function parse()
	{
		if (is_object($this->record->context))
		{
			$this->record->formatted = str_replace("{log-context}", print_r($this->record->context, 1), $this->record->formatted);
		}
		return $this->record;
	}
1288783
public function format(array $record)
    {
        $output = $this->addTitle($record['level_name'], $record['level']);
        $output .= '<table cellspacing="1" width="100%" class="monolog-output">';

        if (isset($record['context']['bug'])) {
            $bug = $record['context']['bug'];
            if ($bug instanceof Bug) {
                $output .= $this->addRow('Bug ID', $bug->getId());
                $output .= $this->addRow('Bug Title', $bug->getTitle());
                $output .= $this->addRow('Task Title', $bug->getTask()->getTitle());
                $output .= $this->addRow('Bug Message', $record['message']);
            }
            if (isset($record['context']['path'])) {
                $path = $record['context']['path'];
                if ($path instanceof Path) {
                    $embeddedTable = '<table cellspacing="1" width="100%">';
                    foreach ($path as $index => $step) {
                        $embeddedTable .= $this->addRow('Step', $this->convertToString($index + 1));
                        $embeddedTable .= $this->addRow('Transition', $this->convertToString($step[0]));
                        $embeddedTable .= $this->addRow('Data', $this->convertToString($step[1]));
                        $embeddedTable .= $this->addRow('Places', $this->convertToString(implode('|', $step[2])));

                        $transitionName = $step[0];
                        $subject = $record['context']['subject'];
                        if ($transitionName && $subject instanceof AbstractSubject) {
                            $url = $subject->getScreenshotUrl($bug->getId(), $index);
                            if ($url) {
                                $embeddedTable .= $this->addRow('Screenshot', $this->addImage($url), false);
                            }
                        }
                    }
                    $embeddedTable .= '</table>';
                    $output .= $this->addRow('Steps', $embeddedTable, false);
                }
            }
        }

        return $output.'</table>';
    }
971728
def format(self, record):
        '''
        
        '''
        formatted_record = super(ExcInfoOnLogLevelFormatMixIn, self).format(record)
        exc_info_on_loglevel = getattr(record, 'exc_info_on_loglevel', None)
        exc_info_on_loglevel_formatted = getattr(record, 'exc_info_on_loglevel_formatted', None)
        if exc_info_on_loglevel is None and exc_info_on_loglevel_formatted is None:
            return formatted_record

        # If we reached this far it means the log record was created with exc_info_on_loglevel
        # If this specific handler is enabled for that record, then we should format it to
        # include the exc_info details
        if self.level > exc_info_on_loglevel:
            # This handler is not enabled for the desired exc_info_on_loglevel, don't include exc_info
            return formatted_record

        # If we reached this far it means we should include exc_info
        if not record.exc_info_on_loglevel_instance and not exc_info_on_loglevel_formatted:
            # This should actually never occur
            return formatted_record

        if record.exc_info_on_loglevel_formatted is None:
            # Let's cache the formatted exception to avoid recurring conversions and formatting calls
            if self.formatter is None:  # pylint: disable=access-member-before-definition
                self.formatter = logging._defaultFormatter
            record.exc_info_on_loglevel_formatted = self.formatter.formatException(
                record.exc_info_on_loglevel_instance
            )

        # Let's format the record to include exc_info just like python's logging formatted does
        if formatted_record[-1:] != '\n':
            formatted_record += '\n'

        try:
            formatted_record += record.exc_info_on_loglevel_formatted
        except UnicodeError:
            # According to the standard library logging formatter comments:
            #
            #     Sometimes filenames have non-ASCII chars, which can lead
            #     to errors when s is Unicode and record.exc_text is str
            #     See issue 8924.
            #     We also use replace for when there are multiple
            #     encodings, e.g. UTF-8 for the filesystem and latin-1
            #     for a script. See issue 13232.
            formatted_record += record.exc_info_on_loglevel_formatted.decode(sys.getfilesystemencoding(),
                                                                             'replace')
        # Reset the record.exc_info_on_loglevel_instance because it might need
        # to "travel" through a multiprocessing process and it might contain
        # data which is not pickle'able
        record.exc_info_on_loglevel_instance = None
        return formatted_record
41621
def format(self, record):
        

        fields = record.__dict__.copy()

        if isinstance(record.msg, dict):
            fields.update(record.msg)
            fields.pop('msg')
            msg = ""
        else:
            msg = record.getMessage()

        try:
            msg = msg.format(**fields)
        except (KeyError, IndexError, ValueError):
            pass
        except:
            # in case we can not format the msg properly we log it as is instead of crashing
            msg = msg

        if 'msg' in fields:
            fields.pop('msg')

        if 'exc_info' in fields:
            if fields['exc_info']:
                formatted = tb.format_exception(*fields['exc_info'])
                fields['exception'] = formatted
            fields.pop('exc_info')

        if 'exc_text' in fields and not fields['exc_text']:
            fields.pop('exc_text')

        logr = self.defaults.copy()

        logr.update({'@message': msg,
                     '@timestamp': datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S.%fZ'),
                     '@source_host': self.source_host,
                     '@fields': self._build_fields(logr, fields)})

        return json.dumps(logr, default=self.json_default, cls=self.json_cls)
151035
public function write(LogRecord $record)
    {
        $logLine = array();

        if ($record->time) {
            $timestr = ($this->logLevel >= self::LEVEL_DEBUG) ?
                $this->udate('Y-m-d H:i:s.u T', $record->time) :
                date('Y/m/d h:i:s', $record->time);
            $logLine[] = "[ $timestr ]";
        }

        if ($record->level != null) {
            $logLine[] = self::LEVELS[$record->level];
        }

        $logLine[] = $record->message;

        $message = implode(' ', $logLine) . PHP_EOL;

        if ($this->fp) {
            fwrite($this->fp, $message);
        } else {
            if (isset($GLOBALS['useErrorLog'])) {
                error_log($message);
            } else {
                file_put_contents('php://stderr', $message, FILE_APPEND);
            }
        }

        return $message;
    }
1308264
def format(self, record):
        
        if not hasattr(record, "type"):
            record.type = "   "
        return self._formatter.format(record)