1
0

Enhanced simple log so that the date and time can be set. Bugzilla issue #27528. Contributed by Dennis Lundberg.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@139031 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Burrell Donkin
2004-05-29 10:43:35 +00:00
parent f3152683ee
commit 4d10d0df0c
4 changed files with 41 additions and 11 deletions

View File

@@ -17,7 +17,6 @@
package org.apache.commons.logging.simple;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -29,11 +28,11 @@ import org.apache.commons.logging.impl.SimpleLog;
/**
* <p>TestCase for sipmle logging when running with custom configuration
* <p>TestCase for simple logging when running with custom configuration
* properties.</p>
*
* @author Craig R. McClanahan
* @version $Revision: 1.4 $ $Date: 2004/02/28 21:46:46 $
* @version $Revision: 1.5 $ $Date: 2004/05/29 10:43:35 $
*/
public class CustomConfigTestCase extends DefaultConfigTestCase {
@@ -164,6 +163,8 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
assertEquals(SimpleLog.LOG_LEVEL_DEBUG, ((SimpleLog) log).getLevel());
// Can we validate the extra exposed properties?
assertEquals("yyyy/MM/dd HH:mm:ss:SSS zzz",
((DecoratedSimpleLog) log).getDateTimeFormat());
assertEquals("DecoratedLogger",
((DecoratedSimpleLog) log).getLogName());
assertTrue(!((DecoratedSimpleLog) log).getShowDateTime());

View File

@@ -41,6 +41,11 @@ public class DecoratedSimpleLog extends SimpleLog {
// ------------------------------------------------------------- Properties
public String getDateTimeFormat() {
return (dateTimeFormat);
}
public String getLogName() {
return (logName);
}

View File

@@ -36,7 +36,7 @@ import org.apache.commons.logging.impl.SimpleLog;
* other than selecting the SimpleLog implementation.</p>
*
* @author Craig R. McClanahan
* @version $Revision: 1.4 $ $Date: 2004/02/28 21:46:46 $
* @version $Revision: 1.5 $ $Date: 2004/05/29 10:43:35 $
*/
public class DefaultConfigTestCase extends TestCase {
@@ -178,6 +178,8 @@ public class DefaultConfigTestCase extends TestCase {
assertEquals(SimpleLog.LOG_LEVEL_INFO, ((SimpleLog) log).getLevel());
// Can we validate the extra exposed properties?
assertEquals("yyyy/MM/dd HH:mm:ss:SSS zzz",
((DecoratedSimpleLog) log).getDateTimeFormat());
assertEquals("DecoratedLogger",
((DecoratedSimpleLog) log).getLogName());
assertTrue(!((DecoratedSimpleLog) log).getShowDateTime());