MessageUtils

public final class MessageUtils

Static utilities for classes wishing to implement their own log message formatting. None of the methods here are required in a formatter, but they should help solve problems common to log message formatting.

Functions

Link copied to clipboard
@CanIgnoreReturnValue()
public static boolean appendLogSite(LogSite logSite, StringBuilder out)
Appends log-site information in the default format, including a trailing space.
Link copied to clipboard
public static void safeFormatTo(Formattable value, StringBuilder out, FormatOptions options)
Returns a string representation of the user supplied Formattable, accounting for any possible runtime exceptions.
Link copied to clipboard
public static String safeToString(Object value)
Returns a string representation of the user supplied value accounting for any possible runtime exceptions.