Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/log/test/EntryExitTraceTests.java12
-rw-r--r--org.eclipse.virgo.medic.testfragment/src/main/java/org/eclipse/virgo/medic/log/EntryExitTrace.aj21
-rw-r--r--org.eclipse.virgo.medic/src/main/java/org/eclipse/virgo/medic/log/EntryExitTrace.aj24
3 files changed, 10 insertions, 47 deletions
diff --git a/org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/log/test/EntryExitTraceTests.java b/org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/log/test/EntryExitTraceTests.java
index b476e80..75ba3b8 100644
--- a/org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/log/test/EntryExitTraceTests.java
+++ b/org.eclipse.virgo.medic.integrationtest/src/test/java/org/eclipse/virgo/medic/log/test/EntryExitTraceTests.java
@@ -40,7 +40,7 @@ public class EntryExitTraceTests {
List<LoggingEvent> loggingEvents = StubAppender.getAndResetLoggingEvents(null);
assertEquals(2, loggingEvents.size());
LoggingEvent event = loggingEvents.get(0);
- assertEquals(Level.INFO, event.getLevel());
+ assertEquals(Level.DEBUG, event.getLevel());
assertEquals("> public void test.TestClass.publicTest(boolean)", event.getFormattedMessage());
assertEquals("public void test.TestClass.publicTest(boolean)", event.getArgumentArray()[1]);
}
@@ -51,7 +51,7 @@ public class EntryExitTraceTests {
List<LoggingEvent> loggingEvents = StubAppender.getAndResetLoggingEvents(null);
assertEquals(2, loggingEvents.size());
LoggingEvent event = loggingEvents.get(1);
- assertEquals(Level.INFO, event.getLevel());
+ assertEquals(Level.DEBUG, event.getLevel());
assertEquals("< public void test.TestClass.publicTest(boolean)", event.getFormattedMessage());
assertEquals("public void test.TestClass.publicTest(boolean)", event.getArgumentArray()[1]);
}
@@ -64,7 +64,7 @@ public class EntryExitTraceTests {
List<LoggingEvent> loggingEvents = StubAppender.getAndResetLoggingEvents(null);
assertEquals(2, loggingEvents.size());
LoggingEvent event = loggingEvents.get(1);
- assertEquals(Level.INFO, event.getLevel());
+ assertEquals(Level.DEBUG, event.getLevel());
assertEquals("< public void test.TestClass.publicTest(boolean)", event.getFormattedMessage());
assertEquals(RuntimeException.class.getName(), event.getThrowableProxy().getClassName());
}
@@ -78,7 +78,7 @@ public class EntryExitTraceTests {
List<LoggingEvent> loggingEvents = StubAppender.getAndResetLoggingEvents(null);
assertEquals(2, loggingEvents.size());
LoggingEvent event = loggingEvents.get(0);
- assertEquals(Level.DEBUG, event.getLevel());
+ assertEquals(Level.TRACE, event.getLevel());
assertEquals("> void test.TestClass.packagePrivateTest(boolean)", event.getFormattedMessage());
assertEquals("void test.TestClass.packagePrivateTest(boolean)", event.getArgumentArray()[1]);
}
@@ -91,7 +91,7 @@ public class EntryExitTraceTests {
List<LoggingEvent> loggingEvents = StubAppender.getAndResetLoggingEvents(null);
assertEquals(2, loggingEvents.size());
LoggingEvent event = loggingEvents.get(1);
- assertEquals(Level.DEBUG, event.getLevel());
+ assertEquals(Level.TRACE, event.getLevel());
assertEquals("< void test.TestClass.packagePrivateTest(boolean)", event.getFormattedMessage());
assertEquals("void test.TestClass.packagePrivateTest(boolean)", event.getArgumentArray()[1]);
}
@@ -106,7 +106,7 @@ public class EntryExitTraceTests {
List<LoggingEvent> loggingEvents = StubAppender.getAndResetLoggingEvents(null);
assertEquals(2, loggingEvents.size());
LoggingEvent event = loggingEvents.get(1);
- assertEquals(Level.DEBUG, event.getLevel());
+ assertEquals(Level.TRACE, event.getLevel());
assertEquals("< void test.TestClass.packagePrivateTest(boolean)", event.getFormattedMessage());
assertEquals(RuntimeException.class.getName(), event.getThrowableProxy().getClassName());
}
diff --git a/org.eclipse.virgo.medic.testfragment/src/main/java/org/eclipse/virgo/medic/log/EntryExitTrace.aj b/org.eclipse.virgo.medic.testfragment/src/main/java/org/eclipse/virgo/medic/log/EntryExitTrace.aj
index ed2b3aa..f8066ce 100644
--- a/org.eclipse.virgo.medic.testfragment/src/main/java/org/eclipse/virgo/medic/log/EntryExitTrace.aj
+++ b/org.eclipse.virgo.medic.testfragment/src/main/java/org/eclipse/virgo/medic/log/EntryExitTrace.aj
@@ -31,27 +31,10 @@ public aspect EntryExitTrace pertypewithin(*) {
pointcut logback() : within(ch.qos.logback..*) || within(org.slf4j.impl..*);
- pointcut infoCandidate() : execution(public * *(..)) && !medic() && !logback();
+ pointcut debugCandidate() : execution(public * *(..)) && !medic() && !logback();
- pointcut debugCandidate() : execution(!public !private * *(..)) && !medic() && !logback();
+ pointcut traceCandidate() : execution(!public * *(..)) && !medic() && !logback();
- pointcut traceCandidate() : execution(private * *(..)) && !medic() && !logback();
-
- before() : infoCandidate() {
- getLogger(thisJoinPointStaticPart).info("{} {}", ">", getSignature(thisJoinPointStaticPart));
- }
-
- after() returning : infoCandidate() {
- getLogger(thisJoinPointStaticPart).info("{} {}", "<", getSignature(thisJoinPointStaticPart));
- }
-
- after() throwing(Throwable t) : infoCandidate() {
- Logger logger = getLogger(thisJoinPointStaticPart);
- if (logger.isInfoEnabled()) {
- logger.info(String.format("< %s", getSignature(thisJoinPointStaticPart)), t);
- }
- }
-
before() : debugCandidate() {
getLogger(thisJoinPointStaticPart).debug("{} {}", ">", getSignature(thisJoinPointStaticPart));
}
diff --git a/org.eclipse.virgo.medic/src/main/java/org/eclipse/virgo/medic/log/EntryExitTrace.aj b/org.eclipse.virgo.medic/src/main/java/org/eclipse/virgo/medic/log/EntryExitTrace.aj
index 1687a5a..a7ae778 100644
--- a/org.eclipse.virgo.medic/src/main/java/org/eclipse/virgo/medic/log/EntryExitTrace.aj
+++ b/org.eclipse.virgo.medic/src/main/java/org/eclipse/virgo/medic/log/EntryExitTrace.aj
@@ -42,29 +42,9 @@ public aspect EntryExitTrace pertypewithin(*) {
pointcut getter() : execution(* get*(..));
- pointcut infoCandidate() : execution(public * *(..)) && !setter() && !getter() && !medic() && !util() && !repository() && !kernelUserRegion() && !logback();
+ pointcut debugCandidate() : execution(public * *(..)) && !setter() && !getter() && !medic() && !util() && !repository() && !kernelUserRegion() && !logback();
- pointcut debugCandidate() : execution(!public !private * *(..)) && !setter() && !getter() && !medic() && !util() && !repository() && !kernelUserRegion() && !logback();
-
- pointcut traceCandidate() : execution(private * *(..)) && !setter() && !getter() && !medic() && !util() && !repository() && !kernelUserRegion() && !logback();
-
- before() : infoCandidate() {
- getLogger(thisJoinPointStaticPart).info("{} {}", ">",
- getSignature(thisJoinPointStaticPart));
- }
-
- after() returning : infoCandidate() {
- getLogger(thisJoinPointStaticPart).info("{} {}", "<",
- getSignature(thisJoinPointStaticPart));
- }
-
- after() throwing(Throwable t) : infoCandidate() {
- Logger logger = getLogger(thisJoinPointStaticPart);
- if (logger.isInfoEnabled()) {
- logger.info(String.format("< %s",
- getSignature(thisJoinPointStaticPart)), t);
- }
- }
+ pointcut traceCandidate() : execution(!public * *(..)) && !setter() && !getter() && !medic() && !util() && !repository() && !kernelUserRegion() && !logback();
before() : debugCandidate() {
getLogger(thisJoinPointStaticPart).debug("{} {}", ">",

Back to the top