public abstract class Formatter extends Object implements IFormatter
Represents the interface for formatting log entry messsages.
Modifier | Constructor and Description |
---|---|
protected |
Formatter()
Creates an instance of Formatter.
|
protected |
Formatter(String logHeaderText)
Initializes a new instance of the
Formatter class. |
protected |
Formatter(StringBuilder logHeaderText)
Initializes a new instance of the
Formatter class. |
Modifier and Type | Method and Description |
---|---|
String |
format(Date datatime)
Formats a datetime and return a string to be outputted.
|
String |
format(LogEntry entry)
Formats a log entry and return a string to be outputted.
|
static IFormatter |
getDefaultFormatter()
Gets or sets default formatter
|
String |
getFooter()
Gets or sets the footer.
|
String |
getHeader()
Gets or sets the header.
|
String |
getLogHeader()
Gets or sets the log header
|
static void |
setDefaultFormatter(IFormatter value)
Gets or sets default formatter
|
protected Formatter()
Creates an instance of Formatter.
protected Formatter(StringBuilder logHeaderText)
Initializes a new instance of the Formatter
class.
logHeaderText
- The log header text.public static IFormatter getDefaultFormatter()
Gets or sets default formatter
public static void setDefaultFormatter(IFormatter value)
Gets or sets default formatter
public String format(LogEntry entry)
Formats a log entry and return a string to be outputted.
format
in interface IFormatter
entry
- Log entry to format.public String format(Date datatime)
Formats a datetime and return a string to be outputted.
format
in interface IFormatter
datatime
- The datetime value for formatting to stringpublic String getHeader()
Gets or sets the header.
getHeader
in interface IFormatter
public String getFooter()
Gets or sets the footer.
getFooter
in interface IFormatter
public String getLogHeader()
Gets or sets the log header
getLogHeader
in interface IFormatter