[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch master updated. v_1.0.1-5-g2cd6af6
Gitbot
git-noreply at pixie.qos.ch
Fri Mar 9 18:38:28 CET 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".
The branch, master has been updated
via 2cd6af6e7f10570999fae4c8c03b70aa7b1d407f (commit)
from 38089b6999db113907a8978b229f823bcf552211 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=2cd6af6e7f10570999fae4c8c03b70aa7b1d407f
http://github.com/ceki/logback/commit/2cd6af6e7f10570999fae4c8c03b70aa7b1d407f
commit 2cd6af6e7f10570999fae4c8c03b70aa7b1d407f
Author: Ceki Gulcu <ceki at qos.ch>
Date: Fri Mar 9 18:36:54 2012 +0100
Continued work on LBCORE-234. Have tests pass.
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/encoder/PatternLayoutEncoder.java b/logback-classic/src/main/java/ch/qos/logback/classic/encoder/PatternLayoutEncoder.java
index a4f1c1f..5bf4705 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/encoder/PatternLayoutEncoder.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/encoder/PatternLayoutEncoder.java
@@ -24,6 +24,7 @@ public class PatternLayoutEncoder extends PatternLayoutEncoderBase<ILoggingEvent
PatternLayout patternLayout = new PatternLayout();
patternLayout.setContext(context);
patternLayout.setPattern(getPattern());
+ patternLayout.setOutputPatternAsPresentationHeader(outputPatternAsPresentationHeader);
patternLayout.start();
this.layout = patternLayout;
super.start();
diff --git a/logback-classic/src/test/input/joran/rolling/basic.xml b/logback-classic/src/test/input/joran/rolling/basic.xml
index 5e4902a..e756f08 100644
--- a/logback-classic/src/test/input/joran/rolling/basic.xml
+++ b/logback-classic/src/test/input/joran/rolling/basic.xml
@@ -11,6 +11,7 @@
</rollingPolicy>
<encoder>
<Pattern>%msg%n</Pattern>
+ <outputPatternAsPresentationHeader>false</outputPatternAsPresentationHeader>
</encoder>
</appender>
diff --git a/logback-classic/src/test/input/joran/rolling/timeAndSize.xml b/logback-classic/src/test/input/joran/rolling/timeAndSize.xml
index f50cd03..b42b04e 100644
--- a/logback-classic/src/test/input/joran/rolling/timeAndSize.xml
+++ b/logback-classic/src/test/input/joran/rolling/timeAndSize.xml
@@ -15,6 +15,7 @@
</rollingPolicy>
<encoder>
<Pattern>%msg%n</Pattern>
+ <outputPatternAsPresentationHeader>false</outputPatternAsPresentationHeader>
</encoder>
</appender>
diff --git a/logback-classic/src/test/input/joran/smtp/customBufferSize.xml b/logback-classic/src/test/input/joran/smtp/customBufferSize.xml
index 233bc77..65bda73 100644
--- a/logback-classic/src/test/input/joran/smtp/customBufferSize.xml
+++ b/logback-classic/src/test/input/joran/smtp/customBufferSize.xml
@@ -8,11 +8,12 @@
<Subject>%logger - %m</Subject>
<CyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTrackerImpl">
- <BufferSize>1</BufferSize>
+ <bufferSize>1</bufferSize>
</CyclicBufferTracker>
<layout class="ch.qos.logback.classic.PatternLayout">
- <Pattern>%message</Pattern>
+ <pattern>%message</pattern>
+ <outputPatternAsPresentationHeader>false</outputPatternAsPresentationHeader>
</layout>
</appender>
diff --git a/logback-classic/src/test/input/joran/smtp/customEvaluator.xml b/logback-classic/src/test/input/joran/smtp/customEvaluator.xml
index 32d83a4..f5405da 100644
--- a/logback-classic/src/test/input/joran/smtp/customEvaluator.xml
+++ b/logback-classic/src/test/input/joran/smtp/customEvaluator.xml
@@ -11,6 +11,7 @@
</evaluator>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%message</Pattern>
+ <outputPatternAsPresentationHeader>false</outputPatternAsPresentationHeader>
</layout>
</appender>
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/encoder/PatternLayoutEncoderTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/encoder/PatternLayoutEncoderTest.java
index 6b5dd47..89f9b7a 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/encoder/PatternLayoutEncoderTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/encoder/PatternLayoutEncoderTest.java
@@ -39,6 +39,7 @@ public class PatternLayoutEncoderTest {
@Before
public void setUp() {
ple.setPattern("%m");
+ ple.setOutputPatternAsPresentationHeader(false);
ple.setContext(context);
}
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_GreenTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_GreenTest.java
index fe0a6ba..71a15b8 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_GreenTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_GreenTest.java
@@ -90,6 +90,7 @@ public class SMTPAppender_GreenTest {
PatternLayout layout = new PatternLayout();
layout.setContext(lc);
layout.setFileHeader(HEADER);
+ layout.setOutputPatternAsPresentationHeader(false);
layout.setPattern("%-4relative %mdc [%thread] %-5level %class - %msg%n");
layout.setFileFooter(FOOTER);
layout.start();
diff --git a/logback-core/src/main/java/ch/qos/logback/core/pattern/PatternLayoutBase.java b/logback-core/src/main/java/ch/qos/logback/core/pattern/PatternLayoutBase.java
index 6ce3241..1dee67a 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/pattern/PatternLayoutBase.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/pattern/PatternLayoutBase.java
@@ -34,10 +34,7 @@ abstract public class PatternLayoutBase<E> extends LayoutBase<E> {
Map<String, String> instanceConverterMap = new HashMap<String, String>();
-
-
-
- boolean forceEmptyPresentationHeader = false;
+ protected boolean outputPatternAsPresentationHeader = true;
/**
* Concrete implementations of this class are responsible for elaborating the
@@ -147,19 +144,20 @@ abstract public class PatternLayoutBase<E> extends LayoutBase<E> {
return CoreConstants.EMPTY_STRING;
}
- public boolean isForceEmptyPresentationHeader() {
- return forceEmptyPresentationHeader;
+ public boolean isOutputPatternAsPresentationHeader() {
+ return outputPatternAsPresentationHeader;
}
- public void setForceEmptyPresentationHeader(boolean forceEmptyPresentationHeader) {
- this.forceEmptyPresentationHeader = forceEmptyPresentationHeader;
+ public void setOutputPatternAsPresentationHeader(boolean outputPatternAsPresentationHeader) {
+ this.outputPatternAsPresentationHeader = outputPatternAsPresentationHeader;
}
@Override
public String getPresentationHeader() {
- if(forceEmptyPresentationHeader)
- return null;
- else
+ if(outputPatternAsPresentationHeader)
return getPresentationHeaderPrefix()+pattern;
+ else
+ return super.getPresentationHeader();
+
}
}
diff --git a/logback-core/src/main/java/ch/qos/logback/core/pattern/PatternLayoutEncoderBase.java b/logback-core/src/main/java/ch/qos/logback/core/pattern/PatternLayoutEncoderBase.java
index 8b0d63e..eaccd55 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/pattern/PatternLayoutEncoderBase.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/pattern/PatternLayoutEncoderBase.java
@@ -19,6 +19,7 @@ import ch.qos.logback.core.encoder.LayoutWrappingEncoder;
public class PatternLayoutEncoderBase<E> extends LayoutWrappingEncoder<E> {
String pattern;
+ protected boolean outputPatternAsPresentationHeader = true;
public String getPattern() {
return pattern;
@@ -28,6 +29,14 @@ public class PatternLayoutEncoderBase<E> extends LayoutWrappingEncoder<E> {
this.pattern = pattern;
}
+ public boolean isOutputPatternAsPresentationHeader() {
+ return outputPatternAsPresentationHeader;
+ }
+
+ public void setOutputPatternAsPresentationHeader(boolean outputPatternAsPresentationHeader) {
+ this.outputPatternAsPresentationHeader = outputPatternAsPresentationHeader;
+ }
+
@Override
public void setLayout(Layout<E> layout) {
throw new UnsupportedOperationException("one cannot set the layout of "
diff --git a/logback-core/src/test/java/ch/qos/logback/core/OutputStreamAppenderTest.java b/logback-core/src/test/java/ch/qos/logback/core/OutputStreamAppenderTest.java
index 86130b2..c0caf51 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/OutputStreamAppenderTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/OutputStreamAppenderTest.java
@@ -108,6 +108,8 @@ public class OutputStreamAppenderTest {
String result = baos.toString();
String expectedHeader = emtptyIfNull(fileHeader) + emtptyIfNull(presentationHeader);
+
+ System.out.println(result);
assertTrue(result, result.startsWith(expectedHeader));
String expectedFooter = emtptyIfNull(presentationFooter) + emtptyIfNull(fileFooter);
diff --git a/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayout.java b/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayout.java
index d33e8c0..ce730de 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayout.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayout.java
@@ -29,6 +29,7 @@ public class SamplePatternLayout<E> extends PatternLayoutBase<E> {
public SamplePatternLayout() {
converterMap.put("OTT", Converter123.class.getName());
converterMap.put("hello", ConverterHello.class.getName());
+ outputPatternAsPresentationHeader = false;
}
public Map<String, String> getDefaultConverterMap() {
-----------------------------------------------------------------------
Summary of changes:
.../classic/encoder/PatternLayoutEncoder.java | 1 +
.../src/test/input/joran/rolling/basic.xml | 1 +
.../src/test/input/joran/rolling/timeAndSize.xml | 1 +
.../src/test/input/joran/smtp/customBufferSize.xml | 5 +++--
.../src/test/input/joran/smtp/customEvaluator.xml | 1 +
.../classic/encoder/PatternLayoutEncoderTest.java | 1 +
.../classic/net/SMTPAppender_GreenTest.java | 1 +
.../logback/core/pattern/PatternLayoutBase.java | 20 +++++++++-----------
.../core/pattern/PatternLayoutEncoderBase.java | 9 +++++++++
.../qos/logback/core/OutputStreamAppenderTest.java | 2 ++
.../core/pattern/parser/SamplePatternLayout.java | 1 +
11 files changed, 30 insertions(+), 13 deletions(-)
hooks/post-receive
--
Logback: the generic, reliable, fast and flexible logging framework.
More information about the logback-dev
mailing list