diff --git a/build.xml b/build.xml index 82778c3..a0dc252 100644 --- a/build.xml +++ b/build.xml @@ -3,7 +3,7 @@ @@ -396,15 +396,18 @@ - - - + + + @@ -646,6 +649,31 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/org/apache/commons/logging/impl/SimpleLog.java b/src/java/org/apache/commons/logging/impl/SimpleLog.java index 940ef9d..e09b480 100644 --- a/src/java/org/apache/commons/logging/impl/SimpleLog.java +++ b/src/java/org/apache/commons/logging/impl/SimpleLog.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/SimpleLog.java,v 1.11 2003/08/16 18:21:50 craigmcc Exp $ - * $Revision: 1.11 $ - * $Date: 2003/08/16 18:21:50 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/SimpleLog.java,v 1.12 2003/08/16 21:25:54 craigmcc Exp $ + * $Revision: 1.12 $ + * $Date: 2003/08/16 21:25:54 $ * * ==================================================================== * @@ -63,6 +63,7 @@ package org.apache.commons.logging.impl; import java.io.InputStream; +import java.io.Serializable; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.security.AccessController; @@ -108,9 +109,9 @@ import org.apache.commons.logging.LogConfigurationException; * @author Rod Waldhoff * @author Robert Burrell Donkin * - * @version $Id: SimpleLog.java,v 1.11 2003/08/16 18:21:50 craigmcc Exp $ + * @version $Id: SimpleLog.java,v 1.12 2003/08/16 21:25:54 craigmcc Exp $ */ -public class SimpleLog implements Log { +public class SimpleLog implements Log, Serializable { // ------------------------------------------------------- Class Attributes diff --git a/src/test/org/apache/commons/logging/simple/CustomConfigTestCase.java b/src/test/org/apache/commons/logging/simple/CustomConfigTestCase.java new file mode 100644 index 0000000..559ee05 --- /dev/null +++ b/src/test/org/apache/commons/logging/simple/CustomConfigTestCase.java @@ -0,0 +1,288 @@ +/* + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/test/org/apache/commons/logging/simple/CustomConfigTestCase.java,v 1.1 2003/08/16 21:25:54 craigmcc Exp $ + * $Revision: 1.1 $ + * $Date: 2003/08/16 21:25:54 $ + * + * ==================================================================== + * + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowlegement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowlegement may appear in the software itself, + * if and wherever such third-party acknowlegements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + */ + +package org.apache.commons.logging.simple; + + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import junit.framework.Test; +import junit.framework.TestSuite; + +import org.apache.commons.logging.impl.SimpleLog; + + +/** + *

TestCase for sipmle logging when running with custom configuration + * properties.

+ * + * @author Craig R. McClanahan + * @version $Revision: 1.1 $ $Date: 2003/08/16 21:25:54 $ + */ + +public class CustomConfigTestCase extends DefaultConfigTestCase { + + + // ----------------------------------------------------------- Constructors + + + /** + *

Construct a new instance of this test case.

+ * + * @param name Name of the test case + */ + public CustomConfigTestCase(String name) { + super(name); + } + + + // ----------------------------------------------------- Instance Variables + + + /** + *

The expected log records.

+ */ + protected List expected; + + + /** + *

The message levels that should have been logged.

+ */ + /* + protected Level testLevels[] = + { Level.FINE, Level.INFO, Level.WARNING, Level.SEVERE, Level.SEVERE }; + */ + + + /** + *

The message strings that should have been logged.

+ */ + protected String testMessages[] = + { "debug", "info", "warn", "error", "fatal" }; + + + // ------------------------------------------- JUnit Infrastructure Methods + + + /** + * Set up instance variables required by this test case. + */ + public void setUp() throws Exception { + expected = new ArrayList(); + setUpFactory(); + setUpLog("DecoratedLogger"); + } + + + /** + * Return the tests included in this test suite. + */ + public static Test suite() { + return (new TestSuite(CustomConfigTestCase.class)); + } + + /** + * Tear down instance variables required by this test case. + */ + public void tearDown() { + super.tearDown(); + expected = null; + } + + + // ----------------------------------------------------------- Test Methods + + + // Test logging message strings with exceptions + public void testExceptionMessages() throws Exception { + + ((DecoratedSimpleLog) log).clearCache(); + logExceptionMessages(); + checkExpected(); + + } + + + // Test logging plain message strings + public void testPlainMessages() throws Exception { + + ((DecoratedSimpleLog) log).clearCache(); + logPlainMessages(); + checkExpected(); + + } + + + // Test Serializability of standard instance + public void testSerializable() throws Exception { + + ((DecoratedSimpleLog) log).clearCache(); + logPlainMessages(); + super.testSerializable(); + logExceptionMessages(); + checkExpected(); + + } + + + // -------------------------------------------------------- Support Methods + + + // Check the decorated log instance + protected void checkDecorated() { + + assertNotNull("Log exists", log); + assertEquals("Log class", + "org.apache.commons.logging.simple.DecoratedSimpleLog", + log.getClass().getName()); + + // Can we call level checkers with no exceptions? + assertTrue(log.isDebugEnabled()); + assertTrue(log.isErrorEnabled()); + assertTrue(log.isFatalEnabled()); + assertTrue(log.isInfoEnabled()); + assertTrue(!log.isTraceEnabled()); + assertTrue(log.isWarnEnabled()); + + // Can we retrieve the current log level? + assertEquals(SimpleLog.LOG_LEVEL_DEBUG, ((SimpleLog) log).getLevel()); + + // Can we validate the extra exposed properties? + assertEquals("DecoratedLogger", + ((DecoratedSimpleLog) log).getLogName()); + assertTrue(!((DecoratedSimpleLog) log).getShowDateTime()); + assertTrue(((DecoratedSimpleLog) log).getShowShortName()); + + } + + + // Check the actual log records against the expected ones + protected void checkExpected() { + + List acts = ((DecoratedSimpleLog) log).getCache(); + Iterator exps = expected.iterator(); + int n = 0; + while (exps.hasNext()) { + LogRecord exp = (LogRecord) exps.next(); + LogRecord act = (LogRecord) acts.get(n++); + assertEquals("Row " + n + " type", exp.type, act.type); + assertEquals("Row " + n + " message", exp.message, act.message); + assertEquals("Row " + n + " throwable", exp.t, act.t); + } + + } + + + // Check the standard log instance + protected void checkStandard() { + + checkDecorated(); + + } + + + // Log the messages with exceptions + protected void logExceptionMessages() { + + // Generate log records + Throwable t = new IndexOutOfBoundsException(); + log.trace("trace", t); // Should not actually get logged + log.debug("debug", t); + log.info("info", t); + log.warn("warn", t); + log.error("error", t); + log.fatal("fatal", t); + + // Record the log records we expect + expected.add(new LogRecord(SimpleLog.LOG_LEVEL_DEBUG, "debug", t)); + expected.add(new LogRecord(SimpleLog.LOG_LEVEL_INFO, "info", t)); + expected.add(new LogRecord(SimpleLog.LOG_LEVEL_WARN, "warn", t)); + expected.add(new LogRecord(SimpleLog.LOG_LEVEL_ERROR, "error", t)); + expected.add(new LogRecord(SimpleLog.LOG_LEVEL_FATAL, "fatal", t)); + + } + + + // Log the plain messages + protected void logPlainMessages() { + + // Generate log records + log.trace("trace"); // Should not actually get logged + log.debug("debug"); + log.info("info"); + log.warn("warn"); + log.error("error"); + log.fatal("fatal"); + + // Record the log records we expect + expected.add(new LogRecord(SimpleLog.LOG_LEVEL_DEBUG, "debug", null)); + expected.add(new LogRecord(SimpleLog.LOG_LEVEL_INFO, "info", null)); + expected.add(new LogRecord(SimpleLog.LOG_LEVEL_WARN, "warn", null)); + expected.add(new LogRecord(SimpleLog.LOG_LEVEL_ERROR, "error", null)); + expected.add(new LogRecord(SimpleLog.LOG_LEVEL_FATAL, "fatal", null)); + + } + + +} diff --git a/src/test/org/apache/commons/logging/simple/DecoratedSimpleLog.java b/src/test/org/apache/commons/logging/simple/DecoratedSimpleLog.java new file mode 100644 index 0000000..859d638 --- /dev/null +++ b/src/test/org/apache/commons/logging/simple/DecoratedSimpleLog.java @@ -0,0 +1,135 @@ +/* + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/test/org/apache/commons/logging/simple/DecoratedSimpleLog.java,v 1.1 2003/08/16 21:25:54 craigmcc Exp $ + * $Revision: 1.1 $ + * $Date: 2003/08/16 21:25:54 $ + * + * ==================================================================== + * + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowlegement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowlegement may appear in the software itself, + * if and wherever such third-party acknowlegements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + */ + +package org.apache.commons.logging.simple; + + +import java.util.ArrayList; +import java.util.List; +import org.apache.commons.logging.impl.SimpleLog; + + +/** + *

Decorated instance of SimpleLog to expose internal state and + * support buffered output.

+ */ + +public class DecoratedSimpleLog extends SimpleLog { + + + // ------------------------------------------------------------ Constructor + + + public DecoratedSimpleLog(String name) { + super(name); + } + + + // ------------------------------------------------------------- Properties + + + public String getLogName() { + return (logName); + } + + + public boolean getShowDateTime() { + return (showDateTime); + } + + + public boolean getShowShortName() { + return (showShortName); + } + + + // ------------------------------------------------------- Protected Methods + + + // Cache logged messages + protected void log(int type, Object message, Throwable t) { + + super.log(type, message, t); + cache.add(new LogRecord(type, message, t)); + + } + + + // ---------------------------------------------------------- Public Methods + + + // Cache of logged records + protected ArrayList cache = new ArrayList(); + + + // Clear cache + public void clearCache() { + cache.clear(); + } + + + // Return cache + public List getCache() { + return (this.cache); + } + + +} diff --git a/src/test/org/apache/commons/logging/simple/DefaultConfigTestCase.java b/src/test/org/apache/commons/logging/simple/DefaultConfigTestCase.java new file mode 100644 index 0000000..1b0e4f3 --- /dev/null +++ b/src/test/org/apache/commons/logging/simple/DefaultConfigTestCase.java @@ -0,0 +1,274 @@ +/* + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/test/org/apache/commons/logging/simple/DefaultConfigTestCase.java,v 1.1 2003/08/16 21:25:54 craigmcc Exp $ + * $Revision: 1.1 $ + * $Date: 2003/08/16 21:25:54 $ + * + * ==================================================================== + * + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowlegement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowlegement may appear in the software itself, + * if and wherever such third-party acknowlegements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + */ + +package org.apache.commons.logging.simple; + + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.logging.impl.SimpleLog; + + +/** + *

TestCase for simple logging when running with zero configuration + * other than selecting the SimpleLog implementation.

+ * + * @author Craig R. McClanahan + * @version $Revision: 1.1 $ $Date: 2003/08/16 21:25:54 $ + */ + +public class DefaultConfigTestCase extends TestCase { + + + // ----------------------------------------------------------- Constructors + + + /** + *

Construct a new instance of this test case.

+ * + * @param name Name of the test case + */ + public DefaultConfigTestCase(String name) { + super(name); + } + + + // ----------------------------------------------------- Instance Variables + + + /** + *

The {@link LogFactory} implementation we have selected.

+ */ + protected LogFactory factory = null; + + + /** + *

The {@link Log} implementation we have selected.

+ */ + protected Log log = null; + + + // ------------------------------------------- JUnit Infrastructure Methods + + + /** + * Set up instance variables required by this test case. + */ + public void setUp() throws Exception { + setUpFactory(); + setUpLog("TestLogger"); + } + + + /** + * Return the tests included in this test suite. + */ + public static Test suite() { + return (new TestSuite(DefaultConfigTestCase.class)); + } + + /** + * Tear down instance variables required by this test case. + */ + public void tearDown() { + log = null; + factory = null; + LogFactory.releaseAll(); + } + + + // ----------------------------------------------------------- Test Methods + + + // Test pristine DecoratedSimpleLog instance + public void testPristineDecorated() { + + setUpDecorated("DecoratedLogger"); + checkDecorated(); + + } + + + // Test pristine Log instance + public void testPristineLog() { + + checkStandard(); + + } + + + // Test pristine LogFactory instance + public void testPristineFactory() { + + assertNotNull("LogFactory exists", factory); + assertEquals("LogFactory class", + "org.apache.commons.logging.impl.LogFactoryImpl", + factory.getClass().getName()); + + String names[] = factory.getAttributeNames(); + assertNotNull("Names exists", names); + assertEquals("Names empty", 0, names.length); + + } + + + // Test Serializability of standard instance + public void testSerializable() throws Exception { + + // Serialize and deserialize the instance + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + oos.writeObject(log); + oos.close(); + ByteArrayInputStream bais = + new ByteArrayInputStream(baos.toByteArray()); + ObjectInputStream ois = new ObjectInputStream(bais); + log = (Log) ois.readObject(); + ois.close(); + + // Check the characteristics of the resulting object + checkStandard(); + + } + + + // -------------------------------------------------------- Support Methods + + + + // Check the decorated log instance + protected void checkDecorated() { + + assertNotNull("Log exists", log); + assertEquals("Log class", + "org.apache.commons.logging.simple.DecoratedSimpleLog", + log.getClass().getName()); + + // Can we call level checkers with no exceptions? + assertTrue(!log.isDebugEnabled()); + assertTrue(log.isErrorEnabled()); + assertTrue(log.isFatalEnabled()); + assertTrue(log.isInfoEnabled()); + assertTrue(!log.isTraceEnabled()); + assertTrue(log.isWarnEnabled()); + + // Can we retrieve the current log level? + assertEquals(SimpleLog.LOG_LEVEL_INFO, ((SimpleLog) log).getLevel()); + + // Can we validate the extra exposed properties? + assertEquals("DecoratedLogger", + ((DecoratedSimpleLog) log).getLogName()); + assertTrue(!((DecoratedSimpleLog) log).getShowDateTime()); + assertTrue(((DecoratedSimpleLog) log).getShowShortName()); + + } + + + // Check the standard log instance + protected void checkStandard() { + + assertNotNull("Log exists", log); + assertEquals("Log class", + "org.apache.commons.logging.impl.SimpleLog", + log.getClass().getName()); + + // Can we call level checkers with no exceptions? + assertTrue(!log.isDebugEnabled()); + assertTrue(log.isErrorEnabled()); + assertTrue(log.isFatalEnabled()); + assertTrue(log.isInfoEnabled()); + assertTrue(!log.isTraceEnabled()); + assertTrue(log.isWarnEnabled()); + + // Can we retrieve the current log level? + assertEquals(SimpleLog.LOG_LEVEL_INFO, ((SimpleLog) log).getLevel()); + + } + + + // Set up decorated log instance + protected void setUpDecorated(String name) { + log = new DecoratedSimpleLog(name); + } + + + // Set up factory instance + protected void setUpFactory() throws Exception { + factory = LogFactory.getFactory(); + } + + + // Set up log instance + protected void setUpLog(String name) throws Exception { + log = LogFactory.getLog(name); + } + + +} diff --git a/src/test/org/apache/commons/logging/simple/LogRecord.java b/src/test/org/apache/commons/logging/simple/LogRecord.java new file mode 100644 index 0000000..ca2e0a5 --- /dev/null +++ b/src/test/org/apache/commons/logging/simple/LogRecord.java @@ -0,0 +1,82 @@ +/* + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/test/org/apache/commons/logging/simple/LogRecord.java,v 1.1 2003/08/16 21:25:54 craigmcc Exp $ + * $Revision: 1.1 $ + * $Date: 2003/08/16 21:25:54 $ + * + * ==================================================================== + * + * The Apache Software License, Version 1.1 + * + * Copyright (c) 1999-2003 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, if + * any, must include the following acknowlegement: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowlegement may appear in the software itself, + * if and wherever such third-party acknowlegements normally appear. + * + * 4. The names "The Jakarta Project", "Commons", and "Apache Software + * Foundation" must not be used to endorse or promote products derived + * from this software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + */ + + +package org.apache.commons.logging.simple; + + +import java.io.Serializable; + + +public class LogRecord implements Serializable { + + + public LogRecord(int type, Object message, Throwable t) { + this.type = type; + this.message = message; + this.t = t; + } + + public int type; + public Object message; + public Throwable t; + +}