- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A functional which will convert an ILogEntry into a String representation.
- Author:
- swong
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic ILogEntryFormatter
A default log entry formatter that uses the default string format.static String
The string format used by the DEFAULT formatter used to convert a log entry into a single String. -
Method Summary
Modifier and TypeMethodDescriptionFormat the given log entry as a Stringstatic ILogEntryFormatter
MakeFormatter(String formatStr)
A default log entry formatter that uses the given string format.
-
Field Details
-
DEFAULT_FORMAT
The string format used by the DEFAULT formatter used to convert a log entry into a single String. The format string parameters are in this order: (level, msg, loc) Using indexed positional arguments ("%X$") enables the parameters to be used in any order as well as to use only some of the parameters.- See Also:
- Constant Field Values
-
DEFAULT
A default log entry formatter that uses the default string format.
-
-
Method Details
-
apply
Format the given log entry as a String- Parameters:
logEntry
- The log entry to format- Returns:
- A String representation of the given log entry
-
MakeFormatter
A default log entry formatter that uses the given string format. See the DEFAULT_FORMAT for an example. Use of argument positional indices ("%x$") in the format string will enable the log entry values to be placed anywhere desired in the output string, including ignoring a value if desired.- Parameters:
formatStr
- A format string that takes 3 values in the order: (LogLevel, log_msg_str, code_loc_str) though not all 3 need to be used.- Returns:
- An ILogEntryFormatter instance
-