aboutsummaryrefslogtreecommitdiffstats
path: root/weaver5
diff options
context:
space:
mode:
authormwebster <mwebster>2006-08-09 15:53:53 +0000
committermwebster <mwebster>2006-08-09 15:53:53 +0000
commit7a0f7a45b24c8dc9c63141edcb57f80f4a358f63 (patch)
tree0d9888f646dc8779f581da46a5c47893633ee3db /weaver5
parente42bdf150dc7dda76eacf36cdb8d7ea1baa75a9e (diff)
downloadaspectj-7a0f7a45b24c8dc9c63141edcb57f80f4a358f63.tar.gz
aspectj-7a0f7a45b24c8dc9c63141edcb57f80f4a358f63.zip
Bug 150487 "Tracing and Logging Framework" (support debug, info, warn, error and fatal)
Diffstat (limited to 'weaver5')
-rw-r--r--weaver5/java5-src/org/aspectj/weaver/tools/Jdk14Trace.java30
-rw-r--r--weaver5/java5-testsrc/org/aspectj/weaver/Jdk14TraceTest.java35
2 files changed, 31 insertions, 34 deletions
diff --git a/weaver5/java5-src/org/aspectj/weaver/tools/Jdk14Trace.java b/weaver5/java5-src/org/aspectj/weaver/tools/Jdk14Trace.java
index 7847e6127..ffb49939e 100644
--- a/weaver5/java5-src/org/aspectj/weaver/tools/Jdk14Trace.java
+++ b/weaver5/java5-src/org/aspectj/weaver/tools/Jdk14Trace.java
@@ -77,5 +77,35 @@ public class Jdk14Trace extends AbstractTrace {
logger.setLevel(Level.INFO);
}
}
+
+ public void debug (String message) {
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine(message);
+ }
+ }
+
+ public void info(String message) {
+ if (logger.isLoggable(Level.INFO)) {
+ logger.info(message);
+ }
+ }
+
+ public void warn (String message, Throwable th) {
+ if (logger.isLoggable(Level.WARNING)) {
+ logger.log(Level.WARNING,message,th);
+ }
+ }
+
+ public void error (String message, Throwable th) {
+ if (logger.isLoggable(Level.SEVERE)) {
+ logger.log(Level.SEVERE,message,th);
+ }
+ }
+
+ public void fatal (String message, Throwable th) {
+ if (logger.isLoggable(Level.SEVERE)) {
+ logger.log(Level.SEVERE,message,th);
+ }
+ }
}
diff --git a/weaver5/java5-testsrc/org/aspectj/weaver/Jdk14TraceTest.java b/weaver5/java5-testsrc/org/aspectj/weaver/Jdk14TraceTest.java
index 283aadb55..5accd227b 100644
--- a/weaver5/java5-testsrc/org/aspectj/weaver/Jdk14TraceTest.java
+++ b/weaver5/java5-testsrc/org/aspectj/weaver/Jdk14TraceTest.java
@@ -13,12 +13,8 @@ package org.aspectj.weaver;
import org.aspectj.weaver.tools.DefaultTrace;
import org.aspectj.weaver.tools.Jdk14Trace;
-import junit.framework.TestCase;
+public class Jdk14TraceTest extends AbstractTraceTest {
-public class Jdk14TraceTest extends TestCase {
-
- private Jdk14Trace trace;
-
protected void setUp() throws Exception {
super.setUp();
trace = new Jdk14Trace(getClass());
@@ -29,35 +25,6 @@ public class Jdk14TraceTest extends TestCase {
Jdk14Trace trace = new Jdk14Trace(getClass());
}
- public void testEnterWithThisAndArgs() {
- trace.enter("testEnterWithThisAndArgs",this,new Object[] { "arg1", "arg2" });
- }
-
- public void testEnterWithThis() {
- trace.enter("testEnterWithThis",this);
- }
-
- public void testEnter() {
- trace.enter("testEnter");
- }
-
- public void testExitWithReturn() {
- trace.exit("testExitWithReturn","ret");
- }
-
- public void testExitWithThrowable() {
- trace.exit("testExitWithThrowable",new RuntimeException());
- }
-
- public void testExit() {
- trace.exit("testExit");
- }
-
- public void testIsTraceEnabled() {
- DefaultTrace trace = new DefaultTrace(getClass());
- assertFalse(trace.isTraceEnabled());
- }
-
public void testSetTraceEnabled() {
DefaultTrace trace = new DefaultTrace(getClass());
trace.setTraceEnabled(true);