java.lang.Object
java.util.logging.Formatter
cl.netswitch.lib.util.LogFormatter
Prints a
LogRecord
using the NetSwitch format.-
Constructor Summary
ConstructorDescriptionConstructs a newLogFormatter
instance.LogFormatter
(boolean delimit) Constructs a newLogFormatter
instance with wrap option. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Deprecated.Returns a formatted string of the supplied log record.Methods inherited from class java.util.logging.Formatter
formatMessage, getHead, getTail
-
Constructor Details
-
LogFormatter
public LogFormatter()Constructs a newLogFormatter
instance. -
LogFormatter
public LogFormatter(boolean delimit) Constructs a newLogFormatter
instance with wrap option.- Parameters:
delimit
- iftrue
the message is written between "[" and "]".
-
-
Method Details
-
format
Returns a formatted string of the supplied log record.- Specified by:
format
in classFormatter
- Parameters:
record
- the log record to be formatted.- Returns:
- a formatted string of the supplied log record.
- Throws:
NullPointerException
- ifrecord
isnull
.
-
changeDefaultFormatters
Deprecated.Use methodLogging.changeDefaultFormatters()
.Changes the formatter of allConsoleHandler
andFileHandler
handlers to aLogFormatter
. AConsoleHandler
will be changed only if it's current formatter is aSimpleFormatter
. AFileHandler
will be changed only if it's current formatter is anXMLFormatter
.- Throws:
SecurityException
- if the formatter of a handler could not be changed.
-
Logging.changeDefaultFormatters()
.