Default log message format replaces

@return void
177146
protected function defaultMessageFormatReplaces()
    {
        $this->messageFormatReplaces = [
            $this->label,
            str_repeat(' ', 9 - strlen($this->label)),
            date('Y-m-d H:i:s e O'),
            $this->message
        ];
    }
334011
protected function resetMessageTypes()
    {
        foreach (array_keys($this->config('types')) as $type) {
            $_SESSION[$this->alias][$type] = [];
        }
    }
1283599
private function updateMessage()
    {
        $this->message = $this->_message;

        if (null !== $this->_source && null !== $this->_seek) {
            $this->message .= sprintf(' in %s at %d.', $this->_source, $this->_seek);
        } elseif (null !== $this->_source) {
            $this->message .= sprintf(' : %s.', $this->_source);
        }

        return $this;
    }
108658
private function logDir(): string
    {
        $logDir = str_replace(
                '{Y}',
                date('Y'),
                str_replace('{M}', date('m'), $this->logDir)
        );
        if (!file_exists($logDir)) {
            mkdir($logDir, $this->filemode, true);
        }

        return $logDir;
    }
377875
protected function messageFormatParser()
    {
        $this->label = $this->levels[$this->level];

        $this->messageOutput = str_replace(
            $this->getMessageFormatSearchs(),
            $this->getMessageFormatReplaces(),
            $this->getMessageFormat()
        );
    }
812241
public function formatMemoryUsage()
    {
        $log = '';
        if (function_exists('memory_get_usage')) {
            $kb = ( int ) (memory_get_usage() / 1024);
            $mb = round($kb / 1024, 3);
            $log .= 'Memory usage: ' . $mb . ' MB';

            if (function_exists('memory_get_peak_usage')) {
                $peakKb = ( int ) (memory_get_peak_usage() / 1024);
                $peakMb = round($peakKb / 1024, 3);
                $log .= ' (peak: ' . $peakMb . ' MB)';
            }
            $log .= '<br />';

            if (version_compare(PHP_VERSION, '5.2.0', '>=')) {
                $kb = ( int ) (memory_get_usage(true) / 1024);
                $mb = round($kb / 1024, 3);
                $log .= 'System memory usage: ' . $mb . ' MB';

                if (function_exists('memory_get_peak_usage')) {
                    $peakKb = ( int ) (memory_get_peak_usage(true) / 1024);
                    $peakMb = round($peakKb / 1024, 3);
                    $log .= ' (peak: ' . $peakMb . ' MB)';
                }
                $log .= '<br />';
            }
        }

        return $log;
    }
431338
public function logDeletion($value)
    {
        if ($this->isOverridden()) {
            return;
        }
        if (isset($this->added[$value])) {
            unset($this->added[$value]);
            $this->ignored[$value] = $value;
            return;
        }
        if (isset($this->replaced[$value])) {
            unset($this->replaced[$value]);
        }
        if (! isset($this->ignored[$value])) {
            $this->deleted[$value] = $value;
        }
    }
2269
def replace_default_error_messages():
    
    forms.Field.default_error_messages['required'] = _('This field is required')
    forms.CharField.default_error_messages['min_length'] = _('You’ve entered too few characters')
    forms.CharField.default_error_messages['max_length'] = _('You’ve entered too many characters')
    forms.IntegerField.default_error_messages['invalid'] = _('Enter a whole number')
    forms.FloatField.default_error_messages['invalid'] = _('Enter a number')
    forms.DecimalField.default_error_messages['invalid'] = _('Enter a number')
    forms.DateField.default_error_messages['invalid'] = _('Enter a valid date')
    forms.TimeField.default_error_messages['invalid'] = _('Enter a valid time')
    forms.DateTimeField.default_error_messages['invalid'] = _('Enter a valid date and time')
    forms.FileField.default_error_messages.update({
        'invalid': _('No file was submitted'),
        'missing': _('No file was submitted'),
        'empty': _('The submitted file is empty'),
    })
    forms.SplitDateTimeField.default_error_messages['invalid_date'] = _('Enter a valid date')
    forms.SplitDateTimeField.default_error_messages['invalid_time'] = _('Enter a valid time')
    validators.EmailValidator.message = _('Enter a valid email address')
379858
public function log($message)
    {

        if (!empty($this->log_file)) {
            //echo $message;
            \file_put_contents($this->log_file, "\n" . $message, \FILE_APPEND);
        }
    }
1142113
public function overwrite($messages, $newline = true, $verbosity = self::VERBOSITY_NORMAL)
    {
        if ($this->hasSupportAnsiCommands() === false || $this->isFirstMessage === true) {
            $this->write($messages, $newline, $verbosity);

            return;
        }

        $messages = implode($newline ? PHP_EOL : '', (array) $messages);
        $numNewLines = substr_count($messages, PHP_EOL);

        $this->write("\x0D", false, $verbosity);
        $this->write("\x1B[2K", false, $verbosity);

        if ($numNewLines > 0) {
            $this->write(str_repeat("\x1B[1A\x1B[2K", $this->formatLineCount), false, $verbosity);
        }

        $this->write($messages, false, $verbosity);

        if ($newline) {
            $this->write('', true, $verbosity);
        }
    }
1162857
private static function format( $log, $show_type = true ) {
			return '[' . str_pad( $log['cnt'], strlen( self::$CNT ), '0', STR_PAD_LEFT ) . '] [' . $log['logger']->_id . '] ' . ( $show_type ? '[' . $log['log_type'] . ']' : '' ) . ( ! empty( $log['class'] ) ? $log['class'] . $log['type'] : '' ) . $log['function'] . ' >> ' . $log['msg'] . ( isset( $log['file'] ) ? ' (' . substr( $log['file'], $log['logger']->_file_start ) . ' ' . $log['line'] . ') ' : '' ) . ' [' . $log['timestamp'] . ']';
		}
23671
private function writeLogs(): void
    {
        // Write logs
        $fileName = $this->getApp()->getConfig()->getDirectory(ConfigInterface::DIR_VAR_LOGS) . '/Berlioz.log';

        if (is_resource($this->fp) || is_resource($this->fp = @fopen($fileName, 'a'))) {
            if (count($this->logs) > 0) {
                foreach ($this->logs as $key => $log) {
                    if (!$log['written']) {
                        $line = sprintf("%-26s %-11s %s\n",
                                        \DateTime::createFromFormat('U.u', number_format($log['time'], 6, '.', ''))
                                                 ->format('Y-m-d H:i:s.u'),
                                        '[' . $log['level'] . ']',
                                        $log['message']);

                        if (@fwrite($this->fp, $line) !== false) {
                            $this->logs[$key]['written'] = true;
                        }
                    }
                }
            }
            unset($log);
        }
    }
998151
public function formatReport()
    {
        $messages = array();
        $report = $this->getReport();

        switch(true){

            case $report instanceof ConstraintViolationListInterface:
                foreach ($report as $constraintViolation){
                    $messages[] = $constraintViolation->getMessage();
                }
                break;

            case $report instanceof FormErrorIterator:
                foreach ($report as $formError) {
                    $messages[] = $formError->getMessage();
                }
                break;

            default:
                $messages[] = $this->getMessage();

        }

        return $messages;
    }
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;
    }
689724
protected function writeLog($message)
    {
        $fileName = 'app/logs/mail/error.log';

        $log = sprintf("[%s]: %s\n", date_format(new \DateTime(), 'Y-m-d H:i:s'), $message);
        file_put_contents($fileName, $log, FILE_APPEND);
    }
1114181
def reset_default_logger():
    
    global logger
    global _loglevel
    global _logfile
    global _formatter
    _loglevel = logging.DEBUG
    _logfile = None
    _formatter = None
    logger = setup_logger(name=LOGZERO_DEFAULT_LOGGER, logfile=_logfile, level=_loglevel, formatter=_formatter)
436734
function Logger_clean(message) {
            if (Type.isString(message)) {
                replace.forEach(function (value) {
                    message = message.replace(value, '');
                });
                message = message.replace(/\\'/g, "'");
                message = message.replace(/\\n/g, "\n");
                return message.replace(/\\u001b/g, '\u001b');
            }
            return message;
        }