Class SLogger.Formatter

  • All Implemented Interfaces:
    Supplier<String>
    Enclosing class:
    SLogger

    public static class SLogger.Formatter
    extends Object
    implements Supplier<String>
    Helper class to format an object for logging.

    The format is only derived when the toString() is called, meaning that if you log one of these and the log level is not enabled, a slow string conversion will never occur.

    Null values are transformed into the special string ‘(null)’.

    Formatted values are cached after the first format operation, even if the underlying object is modified.

    The following types are handled by the Formatter:

    • null
    • Strings
    • Arrays of Objects
    • Arrays of StackTraceElements
    • Collections of Objects
    • Maps
    • Dates and Calendars
    • XML Documents
    • Various SailPointObjects

    Nested objects are also passed through a Formatter.

    • Constructor Detail

      • Formatter

        public Formatter​(Object Item)
        Creates a new formatter.
        Parameters:
        Item - The item to format.
    • Method Detail

      • toString

        public String toString()
        If the formatted value exists, the cached version will be returned.

        Otherwise, the format string will be calculated at this time, cached, and then returned.

        Overrides:
        toString in class Object
        See Also:
        Object.toString()