Formats a RepositoryLogRecord into a localized basic format output String.

@param record  the RepositoryLogRecord to be formatted
@param locale  the Locale to use for localization when formatting this record.

@return the formated string output.
979751
@Override
	public String formatRecord(RepositoryLogRecord record, Locale locale) {
		if (null == record) {
			throw new IllegalArgumentException("Record cannot be null");
		}
		StringBuilder sb = new StringBuilder(300);
		String lineSeparatorPlusPadding = "";


		// Use basic format
		createEventHeader(record, sb);
		lineSeparatorPlusPadding = svLineSeparatorPlusBasicPadding;

		// add the localizedMsg
		sb.append(formatMessage(record, locale));

		// if we have a stack trace, append that to the formatted output.
		if (record.getStackTrace() != null) {
			sb.append(lineSeparatorPlusPadding);
			sb.append(record.getStackTrace());
		}
		return sb.toString();
	}
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;
    }
1309262
def format(self, record):
        """"""
        if record.levelno == logging.DEBUG:
            record.msg = ' {}'.format(record.msg)
        return super(AuditLogFormatter, self).format(record)
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();
    }
68099
def format(self, record):
        """"""
        # NOTE(sdague): default the fancier formating params
        # to an empty string so we don't throw an exception if
        # they get used
        for key in ('instance', 'color'):
            if key not in record.__dict__:
                record.__dict__[key] = ''

        if record.__dict__.get('request_id', None):
            self._fmt = CONF.logging_context_format_string
        else:
            self._fmt = CONF.logging_default_format_string

        if (record.levelno == logging.DEBUG and
                CONF.logging_debug_format_suffix):
            self._fmt += " " + CONF.logging_debug_format_suffix

        # Cache this on the record, Logger will respect our formated copy
        if record.exc_info:
            record.exc_text = self.formatException(record.exc_info, record)
        return logging.Formatter.format(self, record)
530538
def format(self, record: logging.LogRecord) -> str:
        
        if platform.system() != 'Linux':  # Avoid funny logs on Windows & MacOS
            return super().format(record)

        record.msg = (
            self.STYLE[record.levelname] + record.msg + self.STYLE['END'])
        record.levelname = (
            self.STYLE['LEVEL'] + record.levelname + self.STYLE['END'])
        return super().format(record)
1307393
def format(self, record):
        
        if not self.is_tty:
            return super(CLIHandler, self).format(record)

        level_abbrev = record.levelname[0]

        time_and_level = color_string(
            color_for_level(record.levelno),
            "[%(asctime)s " + level_abbrev + "]"
        )
        thread = color_string(
            color_for_thread(record.thread),
            "[%(threadName)s]"
        )
        formatter = logging.Formatter(
            time_and_level + thread + " %(message)s", "%Y-%m-%d %H:%M:%S"
        )

        return formatter.format(record)
547759
protected Logger getSLF4JLogger(LogRecord record) {
        String name = record.getLoggerName();
        if (name == null) {
            name = UNKNOWN_LOGGER_NAME;
        }
        return LoggerFactory.getLogger(name);
    }
653754
def format(self, record):
        """"""
        format_orig = self._fmt
        self._fmt = self.get_level_fmt(record.levelno)
        record.prefix = self.prefix
        record.plugin_id = self.plugin_id
        result = logging.Formatter.format(self, record)
        self._fmt = format_orig
        return result
367395
@Override
  public String format(LogRecord log)
  {
    StringBuilder sb = new StringBuilder();
    
    int mark = 0;

    for (FormatItem item : _formatList) {
      item.format(sb, log, mark);
      
      if (item instanceof PrettyPrintMarkItem) {
        mark = sb.length();
      }
    }
    
    return sb.toString();
  }
328981
public String format(LogRecord record) {
		line.setLength(0);
		line.append('[');
		line.append(Instant.ofEpochMilli(record.getMillis()).toString());

		final Level l = record.getLevel();
		line.append("] ");
		if (l == Level.SEVERE) {
			line.append(SEVERE);
		} else if (l == Level.WARNING) {
			line.append(WARNING);
		} else if (l == Level.INFO) {
			line.append(INFO);
		} else if (l == Level.CONFIG) {
			line.append(CONFIG);
		} else if (l == Level.FINE) {
			line.append(FINE);
		} else if (l == Level.FINER) {
			line.append(FINER);
		} else {
			line.append(FINEST);
		}

		String className = record.getSourceClassName();
		int n;
		if (className == null) {
			className = "unknown";
		} else {
			n = className.lastIndexOf('$');
			if (n > -1) {
				className = className.substring(0, n);
			}
		}
		line.append(className);
		n = line.length();
		if (n > position || position - n > 30) {
			position = n;
		}
		n = 1 + position - n;
		if (n > 0) {
			for (int i = 0; i < n; i++) {
				line.append(' ');
			}
		}
		line.append(formatMessage(record));
		line.append(BREAK);

		// Dump error
		final Throwable cause = record.getThrown();
		if (cause != null) {
			StringBuilder errors = new StringBuilder(256);
			n = appendMessages(errors, cause);
			String trace = errors.toString().trim();
			if (!trace.isEmpty()) {
				for (int i = 0; i < n; i++) {
					line.append('-');
				}
				line.append(BREAK);
				line.append(trace);
				line.append(BREAK);
				for (int i = 0; i < n; i++) {
					line.append('-');
				}
				line.append(BREAK);
			}
			line.append("Trace: ");
			line.append(cause.toString());
			line.append(BREAK);
			StackTraceElement[] array = cause.getStackTrace();
			if (array != null && array.length > 0) {
				for (n = 0; n < array.length; n++) {
					line.append("-> [");
					line.append(n);
					line.append("] ");
					line.append(array[n]);
					line.append(BREAK);
				}
			}
		}
		return line.toString();
	}
387905
protected void createEventTimeStamp(RepositoryLogRecord record, StringBuilder buffer) {
		if (null == record) {
			throw new IllegalArgumentException("Record cannot be null");
		}
		if (null == buffer) {
			throw new IllegalArgumentException("Buffer cannot be null");
		}
		// Create the time stamp
		buffer.append('[');
		Date eventDate = new Date(record.getMillis());
		// set the dateFormat object to the desired timeZone. Allows log output
		// to be presented in different time zones.
		dateFormat.setTimeZone(timeZone); // set the format to
		// the desired
		// time zone.
		buffer.append(dateFormat.format(eventDate));
		buffer.append("] ");
	}
160610
def format(self, record: logging.LogRecord) -> str:
        
        msg: Union[str, dict] = record.msg
        if not isinstance(record.msg, dict):
            msg = {self.default_msg_fieldname: msg}

        if record.exc_info:  # type: ignore
            msg["exc_info"] = record.exc_info
        if record.exc_text:  # type: ignore
            msg["exc_text"] = record.exc_text  # type: ignore

        return self.serializer(msg, default=self._default_handler)
1276375
public String getDescription(final String locale) {
        if (this.uiInfo != null) {
            val description = getLocalizedValues(locale, this.uiInfo.getDescriptions());
            return description != null ? description : super.getDescription();
        }
        return super.getDescription();
    }
1347571
def format(self, record):
        
        formatted = super(IndentingFormatter, self).format(record)
        prefix = ''
        if self.add_timestamp:
            prefix = self.formatTime(record, "%Y-%m-%dT%H:%M:%S ")
        prefix += " " * get_indentation()
        formatted = "".join([
            prefix + line
            for line in formatted.splitlines(True)
        ])
        return formatted
605643
@Override
    public synchronized String format(LogRecord record) {
        cachedDate.setTime(record.getMillis());
        final StringBuilder sb = new StringBuilder();
        sb.append(cachedFormat.format(cachedDate));
        sb.append(" [").append(Thread.currentThread().getName()).append("]");
        sb.append(" ").append(record.getLevel().getName());
        sb.append(" (");
        final String className = record.getSourceClassName();
        if (className != null) {
            if (className.contains(".")) {
                sb.append(className.substring(className.lastIndexOf(".") + ".".length()));
            } else {
                sb.append(className);
            }
            final String methodName = record.getSourceMethodName();
            if (methodName != null) {
                sb.append("@").append(methodName).append("()");
            }
        } else {
            sb.append(record.getLoggerName());
        }
        sb.append(") - ").append(formatMessage(record));
        final Throwable thrown = record.getThrown();
        if (thrown != null) {
            final StringWriter stringWriter = new StringWriter();
            final PrintWriter printWriter = new PrintWriter(stringWriter);
            try {
                printWriter.println();
                thrown.printStackTrace(printWriter);
            } finally {
                printWriter.close();
            }
            sb.append(stringWriter.toString());
        }
        sb.append("\n");
        return sb.toString();
    }
432987
public String consoleLogFormat(LogRecord logRecord, String txt) {
        StringBuilder sb = new StringBuilder(256);
        sb.append(BaseTraceFormatter.levelToString(logRecord.getLevel()));
        sb.append(txt);
        Throwable t = logRecord.getThrown();
        if (t != null) {
            String s = t.getLocalizedMessage();
            if (s == null)
                s = t.toString();
            sb.append(LoggingConstants.nl).append(s);
        }

        return sb.toString();
    }