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/04/20 03:20:43 UTC

logging-log4j2 git commit: Move NullOutputStream to the util package.

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 612de3a8b -> 90bd10150


Move NullOutputStream to the util package.

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

Branch: refs/heads/master
Commit: 90bd10150568bca0a8d7cff6fc5dac89f4dee4e9
Parents: 612de3a
Author: Gary Gregory <ga...@gmail.com>
Authored: Sun Apr 19 18:20:27 2015 -0700
Committer: Gary Gregory <ga...@gmail.com>
Committed: Sun Apr 19 18:20:27 2015 -0700

----------------------------------------------------------------------
 .../core/appender/MemoryMappedFileManager.java  |  1 +
 .../log4j/core/appender/NullOutputStream.java   | 77 --------------------
 .../core/appender/RandomAccessFileManager.java  |  1 +
 .../rolling/RollingRandomAccessFileManager.java |  2 +-
 .../log4j/core/util/NullOutputStream.java       | 77 ++++++++++++++++++++
 .../appender/RandomAccessFileManagerTest.java   |  1 +
 .../RollingRandomAccessFileManagerTest.java     |  2 +-
 7 files changed, 82 insertions(+), 79 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/90bd1015/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java
index 095a80e..bf837b9 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileManager.java
@@ -34,6 +34,7 @@ import java.util.Map;
 import org.apache.logging.log4j.core.Layout;
 import org.apache.logging.log4j.core.util.Assert;
 import org.apache.logging.log4j.core.util.Closer;
+import org.apache.logging.log4j.core.util.NullOutputStream;
 
 /**
  * Extends OutputStreamManager but instead of using a buffered output stream, this class maps a region of a file into

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/90bd1015/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/NullOutputStream.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/NullOutputStream.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/NullOutputStream.java
deleted file mode 100644
index a94f0c8..0000000
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/NullOutputStream.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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.log4j.core.appender;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * Writes all data to the famous <b>/dev/null</b>.
- * <p>
- * This output stream has no destination (file/socket etc.) and all bytes written to it are ignored and lost.
- * </p>
- * Originally from Apache Commons IO.
- * 
- * @since 2.3
- */
-public class NullOutputStream extends OutputStream {
-
-    /**
-     * A singleton.
-     */
-    public static final NullOutputStream NULL_OUTPUT_STREAM = new NullOutputStream();
-
-    /**
-     * Does nothing - output to <code>/dev/null</code>.
-     * 
-     * @param b
-     *        The bytes to write
-     * @param off
-     *        The start offset
-     * @param len
-     *        The number of bytes to write
-     */
-    @Override
-    public void write(final byte[] b, final int off, final int len) {
-        // to /dev/null
-    }
-
-    /**
-     * Does nothing - output to <code>/dev/null</code>.
-     * 
-     * @param b
-     *        The byte to write
-     */
-    @Override
-    public void write(final int b) {
-        // to /dev/null
-    }
-
-    /**
-     * Does nothing - output to <code>/dev/null</code>.
-     * 
-     * @param b
-     *        The bytes to write
-     * @throws IOException
-     *         never
-     */
-    @Override
-    public void write(final byte[] b) throws IOException {
-        // to /dev/null
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/90bd1015/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileManager.java
index 5276462..d0439da 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileManager.java
@@ -26,6 +26,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.logging.log4j.core.Layout;
+import org.apache.logging.log4j.core.util.NullOutputStream;
 
 /**
  * Extends OutputStreamManager but instead of using a buffered output stream,

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/90bd1015/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java
index 06bcfb0..6c0f563 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManager.java
@@ -26,7 +26,7 @@ import java.nio.ByteBuffer;
 import org.apache.logging.log4j.core.Layout;
 import org.apache.logging.log4j.core.appender.AppenderLoggingException;
 import org.apache.logging.log4j.core.appender.ManagerFactory;
-import org.apache.logging.log4j.core.appender.NullOutputStream;
+import org.apache.logging.log4j.core.util.NullOutputStream;
 
 /**
  * Extends RollingFileManager but instead of using a buffered output stream,

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/90bd1015/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NullOutputStream.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NullOutputStream.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NullOutputStream.java
new file mode 100644
index 0000000..7033f31
--- /dev/null
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/NullOutputStream.java
@@ -0,0 +1,77 @@
+/*
+ * 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.log4j.core.util;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * Writes all data to the famous <b>/dev/null</b>.
+ * <p>
+ * This output stream has no destination (file/socket etc.) and all bytes written to it are ignored and lost.
+ * </p>
+ * Originally from Apache Commons IO.
+ * 
+ * @since 2.3
+ */
+public class NullOutputStream extends OutputStream {
+
+    /**
+     * A singleton.
+     */
+    public static final NullOutputStream NULL_OUTPUT_STREAM = new NullOutputStream();
+
+    /**
+     * Does nothing - output to <code>/dev/null</code>.
+     * 
+     * @param b
+     *        The bytes to write
+     * @param off
+     *        The start offset
+     * @param len
+     *        The number of bytes to write
+     */
+    @Override
+    public void write(final byte[] b, final int off, final int len) {
+        // to /dev/null
+    }
+
+    /**
+     * Does nothing - output to <code>/dev/null</code>.
+     * 
+     * @param b
+     *        The byte to write
+     */
+    @Override
+    public void write(final int b) {
+        // to /dev/null
+    }
+
+    /**
+     * Does nothing - output to <code>/dev/null</code>.
+     * 
+     * @param b
+     *        The bytes to write
+     * @throws IOException
+     *         never
+     */
+    @Override
+    public void write(final byte[] b) throws IOException {
+        // to /dev/null
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/90bd1015/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/RandomAccessFileManagerTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/RandomAccessFileManagerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/RandomAccessFileManagerTest.java
index d45e5b8..7aa6df7 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/RandomAccessFileManagerTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/RandomAccessFileManagerTest.java
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.io.OutputStream;
 import java.io.RandomAccessFile;
 
+import org.apache.logging.log4j.core.util.NullOutputStream;
 import org.junit.Test;
 
 import static org.junit.Assert.*;

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/90bd1015/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerTest.java
index ef0d169..75f422e 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingRandomAccessFileManagerTest.java
@@ -24,8 +24,8 @@ import java.io.OutputStream;
 import java.io.RandomAccessFile;
 import java.util.concurrent.locks.LockSupport;
 
-import org.apache.logging.log4j.core.appender.NullOutputStream;
 import org.apache.logging.log4j.core.util.Closer;
+import org.apache.logging.log4j.core.util.NullOutputStream;
 import org.apache.logging.log4j.util.Strings;
 import org.junit.Test;