public class DefaultFormatter extends java.util.logging.Formatter implements ImplementationIF
The constructor is able to consume the following properties:
| Property Keyword | Datatype | Default | Description |
|---|---|---|---|
| FORMAT | String | {0,date} {0,time}.{1,number,###} diff: {2,number,#####} Thread 0x{3} {6} {4} {5}{7} | The output format. |
| LINEBRAK | String | space | The line break character before message, if exists. |
| SEPARATOR | String | space | The message separator string. |
ImplementationIF| Modifier and Type | Field and Description |
|---|---|
protected java.util.Properties |
arguments
The arguments of the implementation.
|
protected XSDContextIF |
ctx
The context.
|
protected java.util.Date |
dat |
static java.lang.String |
DEFAULT_FORMAT_STRING |
static java.lang.String |
DEFAULT_LINEBREAK |
static java.lang.String |
DEFAULT_SEPARATOR |
protected java.lang.Object |
descriptor
The XML object descriptor.
|
protected java.text.MessageFormat |
formatter |
protected long |
lastLog |
protected java.lang.String |
linebreak |
protected java.lang.String |
separator |
| Constructor and Description |
|---|
DefaultFormatter()
Create the formatter.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
format(java.util.logging.LogRecord record)
Format the given LogRecord.
|
XSDContextIF |
getContext()
Get the context.
|
java.lang.Object |
getDescriptor()
Get the descriptor as an Object.
|
void |
init()
Initialize the work.
|
void |
setArguments(java.util.Properties args)
Set argument property map.
|
void |
setContext(XSDContextIF ctx)
Set the context.
|
void |
setDescriptor(java.lang.Object descriptor)
Set the xml tree descriptor.
|
public static final java.lang.String DEFAULT_FORMAT_STRING
public static final java.lang.String DEFAULT_LINEBREAK
public static final java.lang.String DEFAULT_SEPARATOR
protected java.text.MessageFormat formatter
protected java.lang.String linebreak
protected java.lang.String separator
protected java.util.Date dat
protected long lastLog
protected XSDContextIF ctx
protected java.util.Properties arguments
protected java.lang.Object descriptor
public void setContext(XSDContextIF ctx)
setContext in interface ImplementationIFctx - the context.public XSDContextIF getContext()
getContext in interface ImplementationIFpublic void setArguments(java.util.Properties args)
throws InvalidArgumentException
setArguments in interface ImplementationIFargs - the property mapInvalidArgumentException - if the arguments are not valid.public java.lang.String format(java.util.logging.LogRecord record)
format in class java.util.logging.Formatterrecord - the log record to be formatted.public void setDescriptor(java.lang.Object descriptor)
throws InvalidDescriptorException
setDescriptor in interface ImplementationIFdescriptor - the tree node.InvalidDescriptorException - if the descriptor isn't valid.public java.lang.Object getDescriptor()
getDescriptor in interface ImplementationIFpublic void init()
throws InitializationFailedException
init in interface ImplementationIFInitializationFailedException - if the initialization fails.