org.apache.log4j.pattern
Class NameAbbreviator
java.lang.Object
|
+--org.apache.log4j.pattern.NameAbbreviator
- public abstract class NameAbbreviator
- extends Object
NameAbbreviator generates abbreviated logger and class names.
- Since:
- 1.3
- Author:
- Curt Arnold
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NameAbbreviator
public NameAbbreviator()
getAbbreviator
public static NameAbbreviator getAbbreviator(String pattern)
- Gets an abbreviator.
For example, "%logger{2}" will output only 2 elements of the logger name,
"%logger{1.}" will output only the first character of the non-final elements in the name,
"%logger(1~.2~} will output the first character of the first element, two characters of
the second and subsequent elements and will use a tilde to indicate abbreviated characters.
- Parameters:
pattern
- abbreviation pattern.- Returns:
- abbreviator, will not be null.
getDefaultAbbreviator
public static NameAbbreviator getDefaultAbbreviator()
- Gets default abbreviator.
- Returns:
- default abbreviator.
abbreviate
public abstract void abbreviate(int nameStart,
StringBuffer buf)
- Abbreviates a name in a StringBuffer.
- Parameters:
nameStart
- starting position of name in buf.buf
- buffer, may not be null.
Copyright © 2000-2006 Apache Software Foundation.
Licensed under the Apache License, Version 2.0.