use of org.apache.logging.log4j.message.EntryMessage in project logging-log4j2 by apache.
the class StrictXmlConfigTest method basicFlow.
@Test
public void basicFlow() {
final EntryMessage entry = logger.traceEntry();
logger.traceExit(entry);
final List<LogEvent> events = app.getEvents();
assertEquals(2, events.size(), "Incorrect number of events. Expected 2, actual " + events.size());
}
use of org.apache.logging.log4j.message.EntryMessage in project logging-log4j2 by apache.
the class LoggerTest method flowTracingNoArgs.
@Test
public void flowTracingNoArgs() {
final EntryMessage message = logger.traceEntry();
logger.traceExit(message);
assertEquals(2, results.size());
assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
assertThat("Incorrect Exit", results.get(1), startsWith("EXIT[ FLOW ] TRACE Exit"));
}
use of org.apache.logging.log4j.message.EntryMessage in project logging-log4j2 by apache.
the class LoggerTest method flowTracingString_ObjectArray2.
@Test
public void flowTracingString_ObjectArray2() {
final EntryMessage msg = logger.traceEntry("doFoo(a={}, b={})", 1, 2);
logger.traceExit(msg, 3);
assertEquals(2, results.size());
assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
assertThat("Missing entry data", results.get(0), containsString("doFoo(a=1, b=2)"));
assertThat("Incorrect Exit", results.get(1), startsWith("EXIT[ FLOW ] TRACE Exit"));
assertThat("Missing exit data", results.get(1), containsString("doFoo(a=1, b=2): 3"));
}
use of org.apache.logging.log4j.message.EntryMessage in project logging-log4j2 by apache.
the class LoggerTest method flowTracingVoidReturn.
@Test
public void flowTracingVoidReturn() {
final EntryMessage msg = logger.traceEntry("doFoo(a={}, b={})", 1, 2);
logger.traceExit(msg);
assertEquals(2, results.size());
assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
assertThat("Missing entry data", results.get(0), containsString("doFoo(a=1, b=2)"));
assertThat("Incorrect Exit", results.get(1), startsWith("EXIT[ FLOW ] TRACE Exit"));
assertThat("Missing exit data", results.get(1), endsWith("doFoo(a=1, b=2)"));
}
use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.
the class FieldAnalyzeVisitor method visitEnd.
@Override
public void visitEnd() {
final EntryMessage m = log.traceEntry("fieldSignature={}", fieldSignature);
final String modifier = ASMReflector.toModifier(access, false);
final String fqcn = fieldSignatureVisitor.getResult();
final FieldDescriptor fd = new FieldDescriptor(this.classAnalyzeVisitor.className, this.name, modifier, fqcn);
fd.setTypeParameters(fieldSignatureVisitor.getTypeParameters());
this.classAnalyzeVisitor.getMembers().add(fd);
log.traceExit(m);
}
Aggregations