FormatChar

public enum FormatChar

An enum representing the printf-like formatting characters that must be supported by all logging backends. It is important to note that while backends must accept any of these format specifiers, they are not obliged to implement all specified formatting behavior.

The default term formatter takes care of supporting all these options when expressed in their normal '%X' form (including flags, width and precision). Custom messages parsers must convert arguments into one of these forms before passing then through to the backend.

See also

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

Original Java code of Google Flogger

Entries

Link copied to clipboard

Formats the argument in a manner specific to the chosen logging backend. In many cases this will be equivalent to using STRING, but it allows backend implementations to log more structured representations of known types.

Link copied to clipboard

Formats the argument as a boolean.

Link copied to clipboard

Formats a Unicode code-point. This formatting rule can be applied to any character or integral numeric value, providing that isValidCodePoint returns true. Note that if the argument cannot be represented losslessly as an integer, it must be considered invalid.

Link copied to clipboard

Formats the argument as a decimal integer.

Link copied to clipboard

Formats the argument as an unsigned octal integer.

Link copied to clipboard

Formats the argument as an unsigned hexadecimal integer.

Link copied to clipboard

Formats the argument as a signed decimal floating value.

Link copied to clipboard

Formats the argument using computerized scientific notation.

Link copied to clipboard

Formats the argument using general scientific notation.

Link copied to clipboard

Formats the argument using hexadecimal exponential form. This formatting option is primarily useful when debugging issues with the precise bit-wise representation of doubles because no rounding of the value takes place.

Properties

Link copied to clipboard
Link copied to clipboard
public final FormatType type

Functions

Link copied to clipboard
public char getChar()
Returns the lower-case printf style formatting character.
Link copied to clipboard
Link copied to clipboard
Returns the general format type for this character.
Link copied to clipboard
public static FormatChar of(char c)
Returns the FormatChar instance associated with the given printf format specifier.
Link copied to clipboard
public static FormatChar valueOf(String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard
public static Array<FormatChar> values()

Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.