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.

See also

<a href="https://github.com/google/flogger/blob/cb9e836a897d36a78309ee8badf5cad4e6a2d3d8/api/src/main/java/com/google/common/flogger/backend/MessageUtils.java">

Original Java code of Google Flogger

Functions

Link copied to clipboard
@CanIgnoreReturnValue()
public static boolean appendLogSite(FloggerLogSite 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.