Interface ParameterVisitor

    • Method Detail

      • visit

        void visit​(Object value,
                   FormatChar format,
                   FormatOptions options)
        Visits a log message argument with formatting specified by %s, %d etc...

        Note that this method may still visit arguments which represent date/time values if the format is not explicit (e.g. log("time=%s", dateTime)).

        Parameters:
        value - the non-null log message argument.
        format - the printf format specifier.
        options - formatting options.
      • visitDateTime

        void visitDateTime​(Object value,
                           DateTimeFormat format,
                           FormatOptions options)
        Visits a date/time log message argument with formatting specified by %t or similar.

        Note that because this method is called based on the specified format (and not the argument type) it may visit arguments whose type is not a known date/time value. This is necessary to permit new date/time types to be supported by different logging backends (e.g. JodaTime).

        Parameters:
        value - the non-null log message argument.
        format - the date/time format specifier.
        options - formatting options.
      • visitPreformatted

        void visitPreformatted​(Object value,
                               String formatted)
        Visits a log message argument for which formatting has already occurred. This method is only invoked when non-printf message formatting is used (e.g. brace style formatting).

        This method is intended for use by Parameter implementations which describe formatting rules which cannot by represented by either FormatChar or DateTimeFormat. This method discards formatting and type information, and the visitor implementation may choose to reexamine the type of the original argument if doing structural logging.

        Parameters:
        value - the original non-null log message argument.
        formatted - the formatted representation of the argument
      • visitMissing

        void visitMissing()
        Visits a missing argument. This method is called when there is no corresponding value for the parameter's argument index.
      • visitNull

        void visitNull()
        Visits a null argument.