Class LogFormatter
java.lang.Object
java.util.logging.Formatter
cl.netswitch.lib.util.LogFormatter
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newLogFormatterinstance.LogFormatter(boolean delimit) Constructs a newLogFormatterinstance with wrap option. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDeprecated.Returns a formatted string of the supplied log record.Methods inherited from class Formatter
formatMessage, getHead, getTail
-
Constructor Details
-
LogFormatter
public LogFormatter()Constructs a newLogFormatterinstance. -
LogFormatter
public LogFormatter(boolean delimit) Constructs a newLogFormatterinstance with wrap option.- Parameters:
delimit- iftruethe message is written between "[" and "]".
-
-
Method Details
-
format
Returns a formatted string of the supplied log record.- Specified by:
formatin classFormatter- Parameters:
record- the log record to be formatted.- Returns:
- a formatted string of the supplied log record.
- Throws:
NullPointerException- ifrecordisnull.
-
changeDefaultFormatters
Deprecated.Use methodLogging.changeDefaultFormatters().Changes the formatter of allConsoleHandlerandFileHandlerhandlers to aLogFormatter. AConsoleHandlerwill be changed only if it's current formatter is aSimpleFormatter. AFileHandlerwill be changed only if it's current formatter is anXMLFormatter.- Throws:
SecurityException- if the formatter of a handler could not be changed.
-
Logging.changeDefaultFormatters().