Interface ParameterVisitor
-
- All Known Implementing Classes:
BaseMessageFormatter
public interface ParameterVisitorA visitor of log message arguments, dispatched byParameterinstances.- See Also:
- Original Java code of Google Flogger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidvisit(Object value, FormatChar format, FormatOptions options)Visits a log message argument with formatting specified by%s,%detc...voidvisitDateTime(Object value, DateTimeFormat format, FormatOptions options)Visits a date/time log message argument with formatting specified by%tor similar.voidvisitMissing()Visits a missing argument.voidvisitNull()Visits a null argument.voidvisitPreformatted(Object value, String formatted)Visits a log message argument for which formatting has already occurred.
-
-
-
Method Detail
-
visit
void visit(Object value, FormatChar format, FormatOptions options)
Visits a log message argument with formatting specified by%s,%detc...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%tor 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
Parameterimplementations which describe formatting rules which cannot by represented by eitherFormatCharorDateTimeFormat. 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.
-
-