[prev in list] [next in list] [prev in thread] [next in thread]
List: cactus-dev
Subject: cvs commit: jakarta-cactus/src/framework/share/org/apache/cactus AbstractTestCase.java
From: vmassol () apache ! org
Date: 2001-12-01 14:11:00
[Download RAW message or body]
vmassol 01/12/01 06:11:00
Modified: conf/sample/conf/test/share log_client.properties
log_server.properties
docs/framework/xdocs changes.xml
src/framework/share/org/apache/cactus AbstractTestCase.java
Log:
new AbstractTestCase.getLogger() to perform logging from test case classes + new \
default log4j root category with priority of debug + moved cactus category priority \
to warn (in order not to generate debug logs by default)
Revision Changes Path
1.7 +7 -1 \
jakarta-cactus/conf/sample/conf/test/share/log_client.properties
Index: log_client.properties
===================================================================
RCS file: /home/cvs/jakarta-cactus/conf/sample/conf/test/share/log_client.properties,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- log_client.properties 2001/09/15 12:40:42 1.6
+++ log_client.properties 2001/12/01 14:10:59 1.7
@@ -8,4 +8,10 @@
log4j.appender.cactus.layout = org.apache.log4j.PatternLayout
log4j.appender.cactus.layout.ConversionPattern = %d{ABSOLUTE} [%t] %-5p \
%-30.30c{2} %x - %m %n
-log4j.category.org.apache.cactus = DEBUG, cactus
\ No newline at end of file
+# Any application log which uses Log4J will be logged to the Cactus log file
+log4j.rootCategory=DEBUG, cactus
+
+# By default we don't log at the DEBUG level for Cactus log, in order not to \
generate too +# many logs. However, should a problem arise and logs need to be sent \
to the Cactus dev team, +# then we will ask you to change this to DEBUG.
+log4j.category.org.apache.cactus = WARN, cactus
1.7 +7 -1 \
jakarta-cactus/conf/sample/conf/test/share/log_server.properties
Index: log_server.properties
===================================================================
RCS file: /home/cvs/jakarta-cactus/conf/sample/conf/test/share/log_server.properties,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- log_server.properties 2001/09/15 12:40:42 1.6
+++ log_server.properties 2001/12/01 14:10:59 1.7
@@ -8,4 +8,10 @@
log4j.appender.cactus.layout = org.apache.log4j.PatternLayout
log4j.appender.cactus.layout.ConversionPattern = %d{ABSOLUTE} [%t] %-5p \
%-30.30c{2} %x - %m %n
-log4j.category.org.apache.cactus = DEBUG, cactus
\ No newline at end of file
+# Any application log which uses Log4J will be logged to the Cactus log file
+log4j.rootCategory=DEBUG, cactus
+
+# By default we don't log at the DEBUG level for Cactus log, in order not to \
generate too +# many logs. However, should a problem arise and logs need to be sent \
to the Cactus dev team, +# then we will ask you to change this to DEBUG.
+log4j.category.org.apache.cactus = WARN, cactus
1.67 +9 -0 jakarta-cactus/docs/framework/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/jakarta-cactus/docs/framework/xdocs/changes.xml,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- changes.xml 2001/11/16 22:09:54 1.66
+++ changes.xml 2001/12/01 14:11:00 1.67
@@ -128,6 +128,15 @@
<release version="1.3 in CVS">
<action dev="VMA" type="add">
+ Added a <code>AbstractTestCase.getLogger()</code> method that lets any \
test case class get + access to a logger to perform its own logging. Logs \
will go into the Cactus log files. + </action>
+ <action dev="VMA" type="update">
+ By default, the Cactus log4j configuration file defines a root category \
that logs to the + Cactus log file with a DEBUG Priority. There is another \
category for the Cactus classes + with a Priority of WARN so that no debug \
logs will be printed by default. + </action>
+ <action dev="VMA" type="add">
Cactus is now using AspectJ under the hood to provide automatic logging of \
entries and
exits of methods (for debugging purpose) and to automatically initialise \
the logging
subsystem. The next step is to add automatic configuration checking using \
AspectJ. The
1.17 +12 -3 \
jakarta-cactus/src/framework/share/org/apache/cactus/AbstractTestCase.java
Index: AbstractTestCase.java
===================================================================
RCS file: /home/cvs/jakarta-cactus/src/framework/share/org/apache/cactus/AbstractTestCase.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- AbstractTestCase.java 2001/11/16 22:09:54 1.16
+++ AbstractTestCase.java 2001/12/01 14:11:00 1.17
@@ -72,7 +72,7 @@
*
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
*
- * @version $Id: AbstractTestCase.java,v 1.16 2001/11/16 22:09:54 vmassol Exp $
+ * @version $Id: AbstractTestCase.java,v 1.17 2001/12/01 14:11:00 vmassol Exp $
*/
public abstract class AbstractTestCase extends TestCase
{
@@ -108,7 +108,7 @@
/**
* The logger (only used on the client side).
*/
- protected Log logger;
+ private Log logger;
/**
* Constructs a JUnit test case with the given name.
@@ -122,6 +122,15 @@
}
/**
+ * @return the logger used by the <code>TestCase</code> class and
+ * subclasses to perform logging.
+ */
+ protected final Log getLogger()
+ {
+ return this.logger;
+ }
+
+ /**
* @return the name of the test method to call without the
* TEST_METHOD_PREFIX prefix
*/
@@ -448,7 +457,7 @@
// on the server side and on the client side, we need to differentiate
// the logging initialisation. This method is only called on the server
// side, so we instanciate the log for server side here.
- if (this.logger == null) {
+ if (getLogger() == null) {
this.logger =
LogService.getInstance().getLog(this.getClass().getName());
}
--
To unsubscribe, e-mail: <mailto:cactus-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-dev-help@jakarta.apache.org>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic