@Deprecated public class TerseFormatter extends SimpleFormatter
Formatter
for use with the Java Logging API. This is useful for producing terse log
output, and can be used by setting the Formatter
of a Handler to an instance of this class.
In a Java Logging configuration properties file:
<handler>.formatter=snaq.util.logging.TerseFormatter
NOTE: this class is NOT thread-safe.
| Modifier and Type | Field and Description |
|---|---|
protected String |
separator
Deprecated.
Separator string (between log-entry info and log message).
|
| Constructor and Description |
|---|
TerseFormatter()
Deprecated.
Creates a new TerseFormatter instance (all details displayed).
|
TerseFormatter(boolean showClass,
boolean showClassShort,
boolean showMethod)
Deprecated.
Creates a new TerseFormatter instance.
|
TerseFormatter(boolean showLevel,
boolean showClass,
boolean showClassShort,
boolean showMethod)
Deprecated.
Creates a new TerseFormatter instance.
|
| Modifier and Type | Method and Description |
|---|---|
String |
format(LogRecord record)
Deprecated.
|
DateFormat |
getDateFormat()
Deprecated.
|
void |
setDateFormat(DateFormat df)
Deprecated.
Sets the
DateFormat instance to use for formatting log entries. |
void |
setSeparator(String sep)
Deprecated.
Sets the separator string between the date and log message (default ": ").
|
formatMessage, getHead, getTailprotected String separator
public TerseFormatter(boolean showLevel,
boolean showClass,
boolean showClassShort,
boolean showMethod)
showLevel - whether to display log levelsshowClass - whether to display class namesshowClassShort - whether to display short class names (i.e. no package details)showMethod - whether to display method namespublic TerseFormatter(boolean showClass,
boolean showClassShort,
boolean showMethod)
showClass - whether to display class namesshowClassShort - whether to display short class names (i.e. no package details)showMethod - whether to display method namespublic TerseFormatter()
public void setDateFormat(DateFormat df)
DateFormat instance to use for formatting log entries.df - DateFormat instance to usepublic DateFormat getDateFormat()
DateFormat instance used for formatting log entries.public void setSeparator(String sep)
sep - string to use as separatorpublic String format(LogRecord record)
format in class SimpleFormatterCopyright © 2014. All rights reserved.