"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "logback-classic/src/main/java/ch/qos/logback/classic/PatternLayout.java" between
logback-1.2.3.tar.gz and logback-v_1.2.7.tar.gz

About: Logback is a generic Logging Framework (intended as a log4j successor).

PatternLayout.java  (logback-1.2.3):PatternLayout.java  (logback-v_1.2.7)
skipping to change at line 41 skipping to change at line 41
* {#link String}. The format of the result depends on the * {#link String}. The format of the result depends on the
* <em>conversion pattern</em>. * <em>conversion pattern</em>.
* <p> * <p>
* For more information about this layout, please refer to the online manual at * For more information about this layout, please refer to the online manual at
* http://logback.qos.ch/manual/layouts.html#PatternLayout * http://logback.qos.ch/manual/layouts.html#PatternLayout
* *
*/ */
public class PatternLayout extends PatternLayoutBase<ILoggingEvent> { public class PatternLayout extends PatternLayoutBase<ILoggingEvent> {
public static final Map<String, String> defaultConverterMap = new HashMap<St public static final Map<String, String> DEFAULT_CONVERTER_MAP = new HashMap<
ring, String>(); String, String>();
public static final String HEADER_PREFIX = "#logback.classic pattern: "; public static final Map<String, String> CONVERTER_CLASS_TO_KEY_MAP = new Has
hMap<String, String>();
static {
defaultConverterMap.putAll(Parser.DEFAULT_COMPOSITE_CONVERTER_MAP);
defaultConverterMap.put("d", DateConverter.class.getName());
defaultConverterMap.put("date", DateConverter.class.getName());
defaultConverterMap.put("r", RelativeTimeConverter.class.getName());
defaultConverterMap.put("relative", RelativeTimeConverter.class.getName(
));
defaultConverterMap.put("level", LevelConverter.class.getName());
defaultConverterMap.put("le", LevelConverter.class.getName());
defaultConverterMap.put("p", LevelConverter.class.getName());
defaultConverterMap.put("t", ThreadConverter.class.getName());
defaultConverterMap.put("thread", ThreadConverter.class.getName());
defaultConverterMap.put("lo", LoggerConverter.class.getName());
defaultConverterMap.put("logger", LoggerConverter.class.getName());
defaultConverterMap.put("c", LoggerConverter.class.getName());
defaultConverterMap.put("m", MessageConverter.class.getName());
defaultConverterMap.put("msg", MessageConverter.class.getName());
defaultConverterMap.put("message", MessageConverter.class.getName());
defaultConverterMap.put("C", ClassOfCallerConverter.class.getName());
defaultConverterMap.put("class", ClassOfCallerConverter.class.getName())
;
defaultConverterMap.put("M", MethodOfCallerConverter.class.getName()); /**
defaultConverterMap.put("method", MethodOfCallerConverter.class.getName( * @deprecated replaced by DEFAULT_CONVERTER_MAP
)); */
public static final Map<String, String> defaultConverterMap = DEFAULT_CONVER
TER_MAP;
defaultConverterMap.put("L", LineOfCallerConverter.class.getName()); public static final String HEADER_PREFIX = "#logback.classic pattern: ";
defaultConverterMap.put("line", LineOfCallerConverter.class.getName());
defaultConverterMap.put("F", FileOfCallerConverter.class.getName());
defaultConverterMap.put("file", FileOfCallerConverter.class.getName());
defaultConverterMap.put("X", MDCConverter.class.getName());
defaultConverterMap.put("mdc", MDCConverter.class.getName());
defaultConverterMap.put("ex", ThrowableProxyConverter.class.getName());
defaultConverterMap.put("exception", ThrowableProxyConverter.class.getNa
me());
defaultConverterMap.put("rEx", RootCauseFirstThrowableProxyConverter.cla
ss.getName());
defaultConverterMap.put("rootException", RootCauseFirstThrowableProxyCon
verter.class.getName());
defaultConverterMap.put("throwable", ThrowableProxyConverter.class.getNa
me());
defaultConverterMap.put("xEx", ExtendedThrowableProxyConverter.class.get
Name());
defaultConverterMap.put("xException", ExtendedThrowableProxyConverter.cl
ass.getName());
defaultConverterMap.put("xThrowable", ExtendedThrowableProxyConverter.cl
ass.getName());
defaultConverterMap.put("nopex", NopThrowableInformationConverter.class.
getName());
defaultConverterMap.put("nopexception", NopThrowableInformationConverter
.class.getName());
defaultConverterMap.put("cn", ContextNameConverter.class.getName());
defaultConverterMap.put("contextName", ContextNameConverter.class.getNam
e());
defaultConverterMap.put("caller", CallerDataConverter.class.getName());
defaultConverterMap.put("marker", MarkerConverter.class.getName());
defaultConverterMap.put("property", PropertyConverter.class.getName()); static {
DEFAULT_CONVERTER_MAP.putAll(Parser.DEFAULT_COMPOSITE_CONVERTER_MAP);
defaultConverterMap.put("n", LineSeparatorConverter.class.getName()); DEFAULT_CONVERTER_MAP.put("d", DateConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("date", DateConverter.class.getName());
CONVERTER_CLASS_TO_KEY_MAP.put(DateConverter.class.getName(), "date");
DEFAULT_CONVERTER_MAP.put("r", RelativeTimeConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("relative", RelativeTimeConverter.class.getNam
e());
CONVERTER_CLASS_TO_KEY_MAP.put(RelativeTimeConverter.class.getName(), "r
elative");
DEFAULT_CONVERTER_MAP.put("level", LevelConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("le", LevelConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("p", LevelConverter.class.getName());
CONVERTER_CLASS_TO_KEY_MAP.put(LevelConverter.class.getName(), "level");
DEFAULT_CONVERTER_MAP.put("t", ThreadConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("thread", ThreadConverter.class.getName());
CONVERTER_CLASS_TO_KEY_MAP.put(ThreadConverter.class.getName(), "thread"
);
DEFAULT_CONVERTER_MAP.put("lo", LoggerConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("logger", LoggerConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("c", LoggerConverter.class.getName());
CONVERTER_CLASS_TO_KEY_MAP.put(LoggerConverter.class.getName(), "logger"
);
DEFAULT_CONVERTER_MAP.put("m", MessageConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("msg", MessageConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("message", MessageConverter.class.getName());
CONVERTER_CLASS_TO_KEY_MAP.put(MessageConverter.class.getName(), "messag
e");
DEFAULT_CONVERTER_MAP.put("C", ClassOfCallerConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("class", ClassOfCallerConverter.class.getName(
));
CONVERTER_CLASS_TO_KEY_MAP.put(ClassOfCallerConverter.class.getName(), "
class");
DEFAULT_CONVERTER_MAP.put("M", MethodOfCallerConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("method", MethodOfCallerConverter.class.getNam
e());
CONVERTER_CLASS_TO_KEY_MAP.put(MethodOfCallerConverter.class.getName(),
"method");
DEFAULT_CONVERTER_MAP.put("L", LineOfCallerConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("line", LineOfCallerConverter.class.getName())
;
CONVERTER_CLASS_TO_KEY_MAP.put(LineOfCallerConverter.class.getName(), "l
ine");
DEFAULT_CONVERTER_MAP.put("F", FileOfCallerConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("file", FileOfCallerConverter.class.getName())
;
CONVERTER_CLASS_TO_KEY_MAP.put(FileOfCallerConverter.class.getName(), "f
ile");
DEFAULT_CONVERTER_MAP.put("X", MDCConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("mdc", MDCConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("ex", ThrowableProxyConverter.class.getName())
;
DEFAULT_CONVERTER_MAP.put("exception", ThrowableProxyConverter.class.get
Name());
DEFAULT_CONVERTER_MAP.put("rEx", RootCauseFirstThrowableProxyConverter.c
lass.getName());
DEFAULT_CONVERTER_MAP.put("rootException", RootCauseFirstThrowableProxyC
onverter.class.getName());
DEFAULT_CONVERTER_MAP.put("throwable", ThrowableProxyConverter.class.get
Name());
DEFAULT_CONVERTER_MAP.put("xEx", ExtendedThrowableProxyConverter.class.g
etName());
DEFAULT_CONVERTER_MAP.put("xException", ExtendedThrowableProxyConverter.
class.getName());
DEFAULT_CONVERTER_MAP.put("xThrowable", ExtendedThrowableProxyConverter.
class.getName());
DEFAULT_CONVERTER_MAP.put("nopex", NopThrowableInformationConverter.clas
s.getName());
DEFAULT_CONVERTER_MAP.put("nopexception", NopThrowableInformationConvert
er.class.getName());
DEFAULT_CONVERTER_MAP.put("cn", ContextNameConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("contextName", ContextNameConverter.class.getN
ame());
CONVERTER_CLASS_TO_KEY_MAP.put(ContextNameConverter.class.getName(), "co
ntextName");
DEFAULT_CONVERTER_MAP.put("caller", CallerDataConverter.class.getName())
;
CONVERTER_CLASS_TO_KEY_MAP.put(CallerDataConverter.class.getName(), "cal
ler");
DEFAULT_CONVERTER_MAP.put("marker", MarkerConverter.class.getName());
CONVERTER_CLASS_TO_KEY_MAP.put(MarkerConverter.class.getName(), "marker"
);
DEFAULT_CONVERTER_MAP.put("property", PropertyConverter.class.getName())
;
DEFAULT_CONVERTER_MAP.put("n", LineSeparatorConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("black", BlackCompositeConverter.class.getName
());
DEFAULT_CONVERTER_MAP.put("red", RedCompositeConverter.class.getName());
DEFAULT_CONVERTER_MAP.put("green", GreenCompositeConverter.class.getName
());
DEFAULT_CONVERTER_MAP.put("yellow", YellowCompositeConverter.class.getNa
me());
DEFAULT_CONVERTER_MAP.put("blue", BlueCompositeConverter.class.getName()
);
DEFAULT_CONVERTER_MAP.put("magenta", MagentaCompositeConverter.class.get
Name());
DEFAULT_CONVERTER_MAP.put("cyan", CyanCompositeConverter.class.getName()
);
DEFAULT_CONVERTER_MAP.put("white", WhiteCompositeConverter.class.getName
());
DEFAULT_CONVERTER_MAP.put("gray", GrayCompositeConverter.class.getName()
);
DEFAULT_CONVERTER_MAP.put("boldRed", BoldRedCompositeConverter.class.get
Name());
DEFAULT_CONVERTER_MAP.put("boldGreen", BoldGreenCompositeConverter.class
.getName());
DEFAULT_CONVERTER_MAP.put("boldYellow", BoldYellowCompositeConverter.cla
ss.getName());
DEFAULT_CONVERTER_MAP.put("boldBlue", BoldBlueCompositeConverter.class.g
etName());
DEFAULT_CONVERTER_MAP.put("boldMagenta", BoldMagentaCompositeConverter.c
lass.getName());
DEFAULT_CONVERTER_MAP.put("boldCyan", BoldCyanCompositeConverter.class.g
etName());
DEFAULT_CONVERTER_MAP.put("boldWhite", BoldWhiteCompositeConverter.class
.getName());
DEFAULT_CONVERTER_MAP.put("highlight", HighlightingCompositeConverter.cl
ass.getName());
defaultConverterMap.put("black", BlackCompositeConverter.class.getName() DEFAULT_CONVERTER_MAP.put("lsn", LocalSequenceNumberConverter.class.getN
); ame());
defaultConverterMap.put("red", RedCompositeConverter.class.getName()); CONVERTER_CLASS_TO_KEY_MAP.put(LocalSequenceNumberConverter.class.getNam
defaultConverterMap.put("green", GreenCompositeConverter.class.getName() e(), "lsn");
);
defaultConverterMap.put("yellow", YellowCompositeConverter.class.getName
());
defaultConverterMap.put("blue", BlueCompositeConverter.class.getName());
defaultConverterMap.put("magenta", MagentaCompositeConverter.class.getNa
me());
defaultConverterMap.put("cyan", CyanCompositeConverter.class.getName());
defaultConverterMap.put("white", WhiteCompositeConverter.class.getName()
);
defaultConverterMap.put("gray", GrayCompositeConverter.class.getName());
defaultConverterMap.put("boldRed", BoldRedCompositeConverter.class.getNa
me());
defaultConverterMap.put("boldGreen", BoldGreenCompositeConverter.class.g
etName());
defaultConverterMap.put("boldYellow", BoldYellowCompositeConverter.class
.getName());
defaultConverterMap.put("boldBlue", BoldBlueCompositeConverter.class.get
Name());
defaultConverterMap.put("boldMagenta", BoldMagentaCompositeConverter.cla
ss.getName());
defaultConverterMap.put("boldCyan", BoldCyanCompositeConverter.class.get
Name());
defaultConverterMap.put("boldWhite", BoldWhiteCompositeConverter.class.g
etName());
defaultConverterMap.put("highlight", HighlightingCompositeConverter.clas
s.getName());
defaultConverterMap.put("lsn", LocalSequenceNumberConverter.class.getNam e()); DEFAULT_CONVERTER_MAP.put("prefix", PrefixCompositeConverter.class.getNa me());
} }
public PatternLayout() { public PatternLayout() {
this.postCompileProcessor = new EnsureExceptionHandling(); this.postCompileProcessor = new EnsureExceptionHandling();
} }
public Map<String, String> getDefaultConverterMap() { public Map<String, String> getDefaultConverterMap() {
return defaultConverterMap; return DEFAULT_CONVERTER_MAP;
} }
public String doLayout(ILoggingEvent event) { public String doLayout(ILoggingEvent event) {
if (!isStarted()) { if (!isStarted()) {
return CoreConstants.EMPTY_STRING; return CoreConstants.EMPTY_STRING;
} }
return writeLoopOnConverters(event); return writeLoopOnConverters(event);
} }
@Override @Override
 End of changes. 8 change blocks. 
107 lines changed or deleted 153 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)