You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2015/12/08 18:30:53 UTC

[6/7] logging-log4j2 git commit: Do not hide.

Do not hide.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/84b6088a
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/84b6088a
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/84b6088a

Branch: refs/heads/master
Commit: 84b6088ad6b825e854488fe8147eedee59ed3bb0
Parents: 6bcb20c
Author: ggregory <gg...@apache.org>
Authored: Mon Dec 7 20:08:24 2015 -0500
Committer: ggregory <gg...@apache.org>
Committed: Mon Dec 7 20:08:24 2015 -0500

----------------------------------------------------------------------
 .../slf4j/SLF4JLoggerContextFactory.java        | 124 +++++++++----------
 1 file changed, 62 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/84b6088a/log4j-to-slf4j/src/main/java/org/apache/logging/slf4j/SLF4JLoggerContextFactory.java
----------------------------------------------------------------------
diff --git a/log4j-to-slf4j/src/main/java/org/apache/logging/slf4j/SLF4JLoggerContextFactory.java b/log4j-to-slf4j/src/main/java/org/apache/logging/slf4j/SLF4JLoggerContextFactory.java
index 4cae70f..aec9458 100644
--- a/log4j-to-slf4j/src/main/java/org/apache/logging/slf4j/SLF4JLoggerContextFactory.java
+++ b/log4j-to-slf4j/src/main/java/org/apache/logging/slf4j/SLF4JLoggerContextFactory.java
@@ -1,62 +1,62 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.slf4j;
-
-import java.net.URI;
-
-import org.apache.logging.log4j.spi.LoggerContext;
-import org.apache.logging.log4j.spi.LoggerContextFactory;
-import org.apache.logging.log4j.status.StatusLogger;
-
-/**
- *
- */
-public class SLF4JLoggerContextFactory implements LoggerContextFactory {
-    private static final StatusLogger LOGGER = StatusLogger.getLogger();
-    private static LoggerContext context = new SLF4JLoggerContext();
-
-    public SLF4JLoggerContextFactory() {
-        // LOG4J2-230, LOG4J2-204 (improve error reporting when misconfigured)
-        boolean misconfigured = false;
-        try {
-            Class.forName("org.slf4j.helpers.Log4jLoggerFactory");
-            misconfigured = true;
-        } catch (final ClassNotFoundException classNotFoundIsGood) {
-            LOGGER.debug("org.slf4j.helpers.Log4jLoggerFactory is not on classpath. Good!");
-        }
-        if (misconfigured) {
-            throw new IllegalStateException("slf4j-impl jar is mutually exclusive with log4j-to-slf4j jar "
-                    + "(the first routes calls from SLF4J to Log4j, the second from Log4j to SLF4J)");
-        }
-    }
-
-    @Override
-    public LoggerContext getContext(final String fqcn, final ClassLoader loader, final Object externalContext,
-                                    final boolean currentContext) {
-        return context;
-    }
-
-    @Override
-    public LoggerContext getContext(final String fqcn, final ClassLoader loader, final Object externalContext,
-                                    final boolean currentContext, final URI configLocation, final String name) {
-        return context;
-    }
-
-    @Override
-    public void removeContext(final LoggerContext context) {
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.slf4j;
+
+import java.net.URI;
+
+import org.apache.logging.log4j.spi.LoggerContext;
+import org.apache.logging.log4j.spi.LoggerContextFactory;
+import org.apache.logging.log4j.status.StatusLogger;
+
+/**
+ *
+ */
+public class SLF4JLoggerContextFactory implements LoggerContextFactory {
+    private static final StatusLogger LOGGER = StatusLogger.getLogger();
+    private static LoggerContext context = new SLF4JLoggerContext();
+
+    public SLF4JLoggerContextFactory() {
+        // LOG4J2-230, LOG4J2-204 (improve error reporting when misconfigured)
+        boolean misconfigured = false;
+        try {
+            Class.forName("org.slf4j.helpers.Log4jLoggerFactory");
+            misconfigured = true;
+        } catch (final ClassNotFoundException classNotFoundIsGood) {
+            LOGGER.debug("org.slf4j.helpers.Log4jLoggerFactory is not on classpath. Good!");
+        }
+        if (misconfigured) {
+            throw new IllegalStateException("slf4j-impl jar is mutually exclusive with log4j-to-slf4j jar "
+                    + "(the first routes calls from SLF4J to Log4j, the second from Log4j to SLF4J)");
+        }
+    }
+
+    @Override
+    public LoggerContext getContext(final String fqcn, final ClassLoader loader, final Object externalContext,
+                                    final boolean currentContext) {
+        return context;
+    }
+
+    @Override
+    public LoggerContext getContext(final String fqcn, final ClassLoader loader, final Object externalContext,
+                                    final boolean currentContext, final URI configLocation, final String name) {
+        return context;
+    }
+
+    @Override
+    public void removeContext(final LoggerContext ignored) {
+    }
+}