[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch master updated. v_0.9.30-49-g30bf0d6
added by portage for gitosis-gentoo
git-noreply at pixie.qos.ch
Wed Oct 26 13:10:55 CEST 2011
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 30bf0d638f0b95bac0ed0912f059d187c560b73d (commit)
from a11c40845b39152164339eba89579eab30c3d7e2 (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=30bf0d638f0b95bac0ed0912f059d187c560b73d
http://github.com/ceki/logback/commit/30bf0d638f0b95bac0ed0912f059d187c560b73d
commit 30bf0d638f0b95bac0ed0912f059d187c560b73d
Author: Ceki Gulcu <ceki at qos.ch>
Date: Wed Oct 26 13:09:14 2011 +0200
upgrade to surefire 2.10, fix ContextDetachingSCLTest
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/jul/LevelChangePropagator.java b/logback-classic/src/main/java/ch/qos/logback/classic/jul/LevelChangePropagator.java
index f437dda..05ffa57 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/jul/LevelChangePropagator.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/jul/LevelChangePropagator.java
@@ -70,7 +70,7 @@ public class LevelChangePropagator extends ContextAwareBase implements LoggerCon
String loggerName = (String) e.nextElement();
java.util.logging.Logger julLogger = lm.getLogger(loggerName);
if (JULHelper.isRegularNonRootLogger(julLogger) && julLogger.getLevel() != null) {
- addInfo("Setting **** level of jul logger [" + loggerName + "] to null");
+ addInfo("Setting level of jul logger [" + loggerName + "] to null");
julLogger.setLevel(null);
}
}
diff --git a/logback-classic/src/test/input/joran/jul/levelChangePropagator0.xml b/logback-classic/src/test/input/joran/jul/levelChangePropagator0.xml
index 026462f..6052995 100644
--- a/logback-classic/src/test/input/joran/jul/levelChangePropagator0.xml
+++ b/logback-classic/src/test/input/joran/jul/levelChangePropagator0.xml
@@ -1,6 +1,3 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE configuration>
-
<configuration debug="false">
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
diff --git a/logback-classic/src/test/input/joran/jul/levelChangePropagator1.xml b/logback-classic/src/test/input/joran/jul/levelChangePropagator1.xml
index cb73f2f..a7f4d4e 100644
--- a/logback-classic/src/test/input/joran/jul/levelChangePropagator1.xml
+++ b/logback-classic/src/test/input/joran/jul/levelChangePropagator1.xml
@@ -1,6 +1,3 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE configuration>
-
<configuration debug="false">
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"/>
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/joran/JoranConfiguratorTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/joran/JoranConfiguratorTest.java
index 188b222..8f85033 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/joran/JoranConfiguratorTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/joran/JoranConfiguratorTest.java
@@ -24,6 +24,7 @@ import ch.qos.logback.classic.jul.JULHelper;
import ch.qos.logback.core.pattern.parser.Parser;
import ch.qos.logback.core.pattern.parser.ScanException;
import ch.qos.logback.core.status.Status;
+import ch.qos.logback.core.testUtil.RandomUtil;
import ch.qos.logback.core.util.CachingDateFormatter;
import ch.qos.logback.core.util.StatusPrinter;
import org.junit.Ignore;
@@ -55,6 +56,7 @@ public class JoranConfiguratorTest {
Logger logger = loggerContext.getLogger(this.getClass().getName());
Logger root = loggerContext.getLogger(Logger.ROOT_LOGGER_NAME);
StatusChecker sc = new StatusChecker(loggerContext);
+ int diff = RandomUtil.getPositiveInt();
void configure(String file) throws JoranException {
JoranConfigurator jc = new JoranConfigurator();
@@ -363,13 +365,15 @@ public class JoranConfiguratorTest {
@Test
public void levelChangePropagator0() throws JoranException, IOException,
InterruptedException {
- java.util.logging.Logger.getLogger("xx").setLevel(java.util.logging.Level.INFO);
+ String loggerName = "changePropagator0"+diff;
+ java.util.logging.Logger.getLogger(loggerName).setLevel(java.util.logging.Level.INFO);
String configFileAsStr = ClassicTestConstants.JORAN_INPUT_PREFIX
+ "/jul/levelChangePropagator0.xml";
configure(configFileAsStr);
+ StatusPrinter.print(loggerContext);
StatusChecker checker = new StatusChecker(loggerContext);
assertTrue(checker.isErrorFree(0));
- verifyJULLevel("xx", null);
+ verifyJULLevel(loggerName, null);
verifyJULLevel("a.b.c", Level.WARN);
verifyJULLevel(Logger.ROOT_LOGGER_NAME, Level.TRACE);
}
@@ -377,15 +381,16 @@ public class JoranConfiguratorTest {
@Test
public void levelChangePropagator1() throws JoranException, IOException,
InterruptedException {
- java.util.logging.Logger.getLogger("xx").setLevel(java.util.logging.Level.INFO);
- verifyJULLevel("xx", Level.INFO);
+ String loggerName = "changePropagator1"+diff;
+ java.util.logging.Logger.getLogger(loggerName).setLevel(java.util.logging.Level.INFO);
+ verifyJULLevel(loggerName, Level.INFO);
String configFileAsStr = ClassicTestConstants.JORAN_INPUT_PREFIX
+ "/jul/levelChangePropagator1.xml";
configure(configFileAsStr);
StatusPrinter.print(loggerContext);
StatusChecker checker = new StatusChecker(loggerContext);
assertTrue(checker.isErrorFree(0));
- verifyJULLevel("xx", Level.INFO);
+ verifyJULLevel(loggerName, Level.INFO);
verifyJULLevel("a.b.c", Level.WARN);
verifyJULLevel(Logger.ROOT_LOGGER_NAME, Level.TRACE);
}
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/selector/ContextDetachingSCLTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/selector/ContextDetachingSCLTest.java
index 1497689..a96c209 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/selector/ContextDetachingSCLTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/selector/ContextDetachingSCLTest.java
@@ -25,19 +25,21 @@ import ch.qos.logback.classic.selector.servlet.ContextDetachingSCL;
import ch.qos.logback.classic.util.ContextSelectorStaticBinder;
import ch.qos.logback.classic.util.MockInitialContext;
import ch.qos.logback.classic.util.MockInitialContextFactory;
+import org.slf4j.LoggerFactoryFriend;
+import org.slf4j.impl.StaticLoggerBinderFriend;
public class ContextDetachingSCLTest {
static String INITIAL_CONTEXT_KEY = "java.naming.factory.initial";
- ContextDetachingSCL cobtextDetachingSCL;
+ ContextDetachingSCL contextDetachingSCL;
@Before
public void setUp() throws Exception {
+
System.setProperty(ClassicConstants.LOGBACK_CONTEXT_SELECTOR, "JNDI");
- //LoggerFactory.setup();
-
- cobtextDetachingSCL = new ContextDetachingSCL();
+
+ contextDetachingSCL = new ContextDetachingSCL();
MockInitialContextFactory.initialize();
MockInitialContext mic = MockInitialContextFactory.getContext();
@@ -45,21 +47,27 @@ public class ContextDetachingSCLTest {
//The property must be set after we setup the Mock
System.setProperty(INITIAL_CONTEXT_KEY, MockInitialContextFactory.class.getName());
-
+
+ // reinitialize the LoggerFactory, These reset methods are reserved for internal use
+ StaticLoggerBinderFriend.reset();
+ LoggerFactoryFriend.reset();
+
//this call will create the context "toto"
LoggerFactory.getLogger(ContextDetachingSCLTest.class);
-
}
@After
public void tearDown() throws Exception {
System.clearProperty(INITIAL_CONTEXT_KEY);
+ // reinitialize the LoggerFactory, These resets method are reserved for internal use
+ StaticLoggerBinderFriend.reset();
+ LoggerFactoryFriend.reset();
}
@Test
public void testDetach() {
ContextJNDISelector selector = (ContextJNDISelector) ContextSelectorStaticBinder.getSingleton().getContextSelector();
- cobtextDetachingSCL.contextDestroyed(null);
+ contextDetachingSCL.contextDestroyed(null);
assertEquals(0, selector.getCount());
}
@@ -73,7 +81,7 @@ public class ContextDetachingSCLTest {
mic.map.put(ClassicConstants.JNDI_CONTEXT_NAME, "titi");
assertEquals("titi", selector.getLoggerContext().getName());
- cobtextDetachingSCL.contextDestroyed(null);
+ contextDetachingSCL.contextDestroyed(null);
assertEquals(2, selector.getCount());
}
diff --git a/logback-core/pom.xml b/logback-core/pom.xml
index 5e64c4d..9d4ba41 100644
--- a/logback-core/pom.xml
+++ b/logback-core/pom.xml
@@ -124,7 +124,6 @@
<forkMode>once</forkMode>
<reportFormat>plain</reportFormat>
<parallel>classes</parallel>
-
<trimStackTrace>false</trimStackTrace>
<excludes>
<exclude>**/All*Test.java</exclude>
diff --git a/logback-examples/src/main/java/chapters/architecture/SelectionRule.java b/logback-examples/src/main/java/chapters/architecture/SelectionRule.java
index 7dbcc52..ba74fd5 100644
--- a/logback-examples/src/main/java/chapters/architecture/SelectionRule.java
+++ b/logback-examples/src/main/java/chapters/architecture/SelectionRule.java
@@ -1,51 +1,51 @@
-/**
- * Logback: the reliable, generic, fast and flexible logging framework.
- * Copyright (C) 1999-2011, QOS.ch. All rights reserved.
- *
- * This program and the accompanying materials are dual-licensed under
- * either the terms of the Eclipse Public License v1.0 as published by
- * the Eclipse Foundation
- *
- * or (per the licensee's choosing)
- *
- * under the terms of the GNU Lesser General Public License version 2.1
- * as published by the Free Software Foundation.
- */
-package chapters.architecture;
-
-import ch.qos.logback.classic.Level;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author Ceki Gücü
- */
-public class SelectionRule {
-
- public static void main(String[] args) {
- // get a logger instance named "com.foo". Let us further assume that the
- // logger is of type ch.qos.logback.classic.Logger so that we can
- // set its level
- ch.qos.logback.classic.Logger logger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger("com.foo");
- //set its Level to INFO. The setLevel() method requires a logback logger
- logger.setLevel(Level.INFO);
-
- Logger barlogger = LoggerFactory.getLogger("com.foo.Bar");
-
- // This request is enabled, because WARN >= INFO
- logger.warn("Low fuel level.");
-
- // This request is disabled, because DEBUG < INFO.
- logger.debug("Starting search for nearest gas station.");
-
- // The logger instance barlogger, named "com.foo.Bar",
- // will inherit its level from the logger named
- // "com.foo" Thus, the following request is enabled
- // because INFO >= INFO.
- barlogger.info("Located nearest gas station.");
-
- // This request is disabled, because DEBUG < INFO.
- barlogger.debug("Exiting gas station search");
-
- }
-}
+/**
+ * Logback: the reliable, generic, fast and flexible logging framework.
+ * Copyright (C) 1999-2011, QOS.ch. All rights reserved.
+ *
+ * This program and the accompanying materials are dual-licensed under
+ * either the terms of the Eclipse Public License v1.0 as published by
+ * the Eclipse Foundation
+ *
+ * or (per the licensee's choosing)
+ *
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ */
+package chapters.architecture;
+
+import ch.qos.logback.classic.Level;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author Ceki Gücü
+ */
+public class SelectionRule {
+
+ public static void main(String[] args) {
+ // get a logger instance named "com.foo". Let us further assume that the
+ // logger is of type ch.qos.logback.classic.Logger so that we can
+ // set its level
+ ch.qos.logback.classic.Logger logger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger("com.foo");
+ //set its Level to INFO. The setLevel() method requires a logback logger
+ logger.setLevel(Level.INFO);
+
+ Logger barlogger = LoggerFactory.getLogger("com.foo.Bar");
+
+ // This request is enabled, because WARN >= INFO
+ logger.warn("Low fuel level.");
+
+ // This request is disabled, because DEBUG < INFO.
+ logger.debug("Starting search for nearest gas station.");
+
+ // The logger instance barlogger, named "com.foo.Bar",
+ // will inherit its level from the logger named
+ // "com.foo" Thus, the following request is enabled
+ // because INFO >= INFO.
+ barlogger.info("Located nearest gas station.");
+
+ // This request is disabled, because DEBUG < INFO.
+ barlogger.debug("Exiting gas station search");
+
+ }
+}
diff --git a/pom.xml b/pom.xml
index 95d9c69..5a0c1d0 100755
--- a/pom.xml
+++ b/pom.xml
@@ -210,10 +210,11 @@
<target>1.5</target>
</configuration>
</plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.6</version>
+ <version>2.10</version>
</plugin>
<plugin>
-----------------------------------------------------------------------
Summary of changes:
.../logback/classic/jul/LevelChangePropagator.java | 2 +-
.../input/joran/jul/levelChangePropagator0.xml | 3 -
.../input/joran/jul/levelChangePropagator1.xml | 3 -
.../classic/joran/JoranConfiguratorTest.java | 15 ++-
.../classic/selector/ContextDetachingSCLTest.java | 24 +++--
logback-core/pom.xml | 1 -
.../java/chapters/architecture/SelectionRule.java | 102 ++++++++++----------
pom.xml | 3 +-
8 files changed, 80 insertions(+), 73 deletions(-)
hooks/post-receive
--
Logback: the generic, reliable, fast and flexible logging framework.
More information about the logback-dev
mailing list