|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.logging.Formatter
java.util.logging.SimpleFormatter
snaq.util.logging.TerseFormatter
public class TerseFormatter
Implementation of a simple single-line log
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
Constructor Summary | |
---|---|
TerseFormatter()
Creates a new TerseFormatter instance (all details displayed). |
|
TerseFormatter(boolean showClass,
boolean showClassShort,
boolean showMethod)
Creates a new TerseFormatter instance. |
|
TerseFormatter(boolean showLevel,
boolean showClass,
boolean showClassShort,
boolean showMethod)
Creates a new TerseFormatter instance. |
Method Summary | |
---|---|
String |
format(LogRecord record)
|
DateFormat |
getDateFormat()
|
void |
setDateFormat(DateFormat df)
Sets the DateFormat instance to use for formatting log entries. |
void |
setSeparator(String sep)
Sets the separator string between the date and log message (default ": "). |
Methods inherited from class java.util.logging.Formatter |
---|
formatMessage, getHead, getTail |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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()
Method Detail |
---|
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 SimpleFormatter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |