public abstract class AbstractAppender extends org.apache.log4j.AppenderSkeleton implements SwingAppender
Modifier and Type | Field and Description |
---|---|
static int |
POS_COLUMN
Position of the message text in the regex result.
|
static int |
POS_FILENAME
Position of the filename in the regex result.
|
static int |
POS_LINE
Position of the lineno in the regex result.
|
static int |
POS_TEXT
Position of the message text in the regex result.
|
protected org.apache.oro.text.regex.Pattern |
regex
The regex to parse the messages.
|
Constructor and Description |
---|
AbstractAppender()
Creates a new AbstractAppender object.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
append(org.apache.log4j.spi.LoggingEvent ev)
Does the actual outputting.
|
protected boolean |
checkEntryConditions() |
void |
close() |
void |
done()
Notifies the appender that a run was finished.
|
org.apache.oro.text.regex.MatchResult |
parseMessage(org.apache.log4j.spi.LoggingEvent ev)
Parses the given message.
|
boolean |
requiresLayout() |
void |
setName(java.lang.String name)
Sets the name of the appender.
|
activateOptions, addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setThreshold
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear
public static final int POS_FILENAME
public static final int POS_LINE
public static final int POS_TEXT
public static final int POS_COLUMN
protected final org.apache.oro.text.regex.Pattern regex
filename:lineno:text
) the pattern will match.public AbstractAppender()
ChainingRuntimeException
- DOCUMENT ME!public abstract void append(org.apache.log4j.spi.LoggingEvent ev)
append
in class org.apache.log4j.AppenderSkeleton
ev
- logging event.public final void setName(java.lang.String name)
setName
in interface org.apache.log4j.Appender
setName
in class org.apache.log4j.AppenderSkeleton
name
- appender name (ignored).public void close()
close
in interface org.apache.log4j.Appender
public void done()
done
in interface SwingAppender
public org.apache.oro.text.regex.MatchResult parseMessage(org.apache.log4j.spi.LoggingEvent ev)
MatchResult result = parseMessage(message); if (result == null) { // handle plain message ... } else { // this is an Emacs style message, you can easily access the // information String filename = result.group(POS_FILENAME); String line = result.group(POS_LINE); String column = result.group(POS_COLUMN); String text = result.group(POS_TEXT); ... }
ev
- logging event.null
if the message doesn't match the
Emacs format filename:line:column:text
.public boolean requiresLayout()
requiresLayout
in interface org.apache.log4j.Appender
true
.protected boolean checkEntryConditions()
true
.
Submit a bug or feature.
For further information and documentation, visit the official Jalopy website.
This page generated: March 30 2013