|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--net.directj.jlogger.PatternFormatter
This is a pattern formatter, that allow you to create you're own format.
There is four paramaters that will be replace by the corresponding logging information:
$type, $message, $time and $name. For example, the DefaultFormatter use the pattern: "[$name] $type - $message #$time", and
it will produce for example "INFO - log1 information #20 d‚c. 2002 03:16:22".
| Field Summary | |
private java.lang.String |
pattern
The pattern. |
| Constructor Summary | |
PatternFormatter(java.lang.String _pattern)
The default constructor, with a specified pattern. |
|
| Method Summary | |
boolean |
equals(java.lang.Object _obj)
Indicates whether some other object is "equal to" this one. |
java.lang.String |
getFooter()
Returns the footer information of the formatter. |
java.lang.String |
getHeader()
Returns the header information of the formatter. |
int |
hashCode()
Returns a hash code value for the object. |
static java.lang.String |
replace(java.lang.String _str,
java.lang.String _repl,
java.lang.String _with,
int _max)
Replace a string with another string inside a larger string, for the first _max values of the search string. |
java.lang.String |
transform(LogRecord _record)
Transforms the given logging info with a special format. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private java.lang.String pattern
| Constructor Detail |
public PatternFormatter(java.lang.String _pattern)
_pattern - The pattern.| Method Detail |
public java.lang.String transform(LogRecord _record)
transform in interface Formatter_record - The log record, where logging information are stored.
String - The String that has been created
using the given logging information.
public static java.lang.String replace(java.lang.String _str,
java.lang.String _repl,
java.lang.String _with,
int _max)
_str - The String to search and replace in._repl - String to search for._with - String to replace with._max - The maximum number of values to replace, or -1 if no maximum.
String - The text with any replacements processed.public java.lang.String getHeader()
getHeader in interface FormatterString - The formatter header.public java.lang.String getFooter()
getFooter in interface FormatterString - The formatter footer.public boolean equals(java.lang.Object _obj)
equals in class java.lang.Object_obj - The reference object with which to compare.
boolean - True if this object is the same as the obj argument; false otherwise.public int hashCode()
hashCode in class java.lang.Objectint - A hash code value for this object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||