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 date)
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.protected Formatter(String logHeaderText)
Initializes a new instance of the Formatter
class.
logHeaderText
- The log header text.public static IFormatter getDefaultFormatter()
Gets or sets default formatter
IFormatter
object.public static void setDefaultFormatter(IFormatter value)
Gets or sets default formatter
value
- a IFormatter
object.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 date)
Formats a datetime and return a string to be outputted.
format
in interface IFormatter
date
- The datetime value for formatting to stringString
object.public String getHeader()
Gets or sets the header.
getHeader
in interface IFormatter
String
object.public String getFooter()
Gets or sets the footer.
getFooter
in interface IFormatter
String
object.public String getLogHeader()
Gets or sets the log header
getLogHeader
in interface IFormatter
String
object.Copyright (c) 2008-2017 Aspose Pty Ltd. All Rights Reserved.