public class ErraiSimpleFormatter extends Formatter
SimpleFormatter
, but the format string is
stored as a JSNI value.setSimpleFormatString(String)
Modifier and Type | Field and Description |
---|---|
static String |
defaultFormat |
Constructor and Description |
---|
ErraiSimpleFormatter() |
ErraiSimpleFormatter(String customFormat) |
Modifier and Type | Method and Description |
---|---|
String |
format(LogRecord record) |
static String |
getSimpleFormatString() |
String |
getSimpleFormatString(String customFormat) |
static void |
setSimpleFormatString(String format)
Set the value for the format string used by all
ErraiSimpleFormatter instances. |
formatMessage, getHead, getTail
public static final String defaultFormat
public ErraiSimpleFormatter()
public ErraiSimpleFormatter(String customFormat)
public static void setSimpleFormatString(String format)
ErraiSimpleFormatter
instances. The provided format string is
called with StringFormat
like so:
StringFormat.format(formatString, date, fullLoggerName, simpleLoggerName, level, throwable)
The parameters are as follows:
formatString
: the format string (see
StringFormat.format(String, Object...)
for details).date
: the log date, either a Long
or Date
.fullLoggerName
: the full name of the logger.simpleLoggerName
: a substring of the full logger name, starting
after the last '.', or the full name if no '.' occurs (i.e. "a.b.c" -->
"c", "abc" --> "abc").level
: the level of the this log entry (i.e. TRACE, DEBUG,
INFO, WARN, ERROR).throwable
: the throwable
accompanying this log entry,
or null
if none provided.StringFormat.format(String, Object...)
is designed to
mimic the call to String.format(String, Object...)
in
SimpleFormatter
, however there are some differences. Please see
StringFormat.format(String, Object...)
for details.format
- The format string for used by all ErraiSimpleFormatter
instances.public static String getSimpleFormatString()
setSimpleFormatString(String)
public String getSimpleFormatString(String customFormat)
customFormat
- the custom format provided when creating this formatter (see
ErraiSimpleFormatter(String)
)Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.