01: package org.jzonic.jlo.formatter.tokens;
02:
03: import org.jzonic.jlo.LogRecord;
04:
05: /**
06: * User: Mecky
07: * Date: 19.07.2005
08: * Time: 12:17:49
09: */
10: public class ShortClassToken implements FormatterToken {
11:
12: public String format(LogRecord lr) {
13: String cl = lr.getSourceClassName();
14: if (cl == null) {
15: return null;
16: }
17: if (cl.indexOf(".") != -1) {
18: return cl.substring(cl.lastIndexOf(".") + 1);
19: }
20: return cl;
21: }
22:
23: public String getName() {
24: return "shortclass";
25: }
26:
27: public void setParameterString(String txt) {
28: }
29: }
|