Search in sources :

Example 26 with EntryMessage

use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.

the class MethodScope method dumpFieldAccess.

@Override
public void dumpFieldAccess() {
    final EntryMessage entryMessage = log.traceEntry("**** {} {} return {}", this.getScopeType(), this.name, this.returnType);
    super.dumpFieldAccess(log);
    for (final ExpressionScope expressionScope : this.expressions) {
        expressionScope.dumpFieldAccess();
    }
    for (final BlockScope blockScope : this.scopes) {
        blockScope.dumpFieldAccess();
    }
    log.traceExit(entryMessage);
}
Also used : EntryMessage(org.apache.logging.log4j.message.EntryMessage)

Example 27 with EntryMessage

use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.

the class MethodScope method dump.

@Override
public void dump() {
    final EntryMessage entryMessage = log.traceEntry("**** {} {} return {} isParameter {}", this.getScopeType(), this.name, this.returnType, this.parameters);
    super.dumpVariable(log);
    for (final ExpressionScope expressionScope : this.expressions) {
        expressionScope.dumpVariable();
    }
    for (final BlockScope blockScope : this.scopes) {
        blockScope.dumpVariable();
    }
    super.dumpFieldAccess(log);
    for (final ExpressionScope expressionScope : this.expressions) {
        expressionScope.dumpFieldAccess();
    }
    for (final BlockScope blockScope : this.scopes) {
        blockScope.dumpFieldAccess();
    }
    log.traceExit(entryMessage);
}
Also used : EntryMessage(org.apache.logging.log4j.message.EntryMessage)

Example 28 with EntryMessage

use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.

the class ClassScope method dumpVariable.

@Override
public void dumpVariable() {
    final EntryMessage entryMessage = log.traceEntry("**** {} {} methods:{}", this.getScopeType(), this.name, this.scopes.size());
    super.dumpVariable(log);
    for (final ExpressionScope expressionScope : this.expressions) {
        expressionScope.dumpVariable();
    }
    for (final BlockScope blockScope : this.scopes) {
        blockScope.dumpVariable();
    }
    for (final ClassScope cs : this.classScopes) {
        cs.dumpVariable();
    }
    log.traceExit(entryMessage);
}
Also used : EntryMessage(org.apache.logging.log4j.message.EntryMessage)

Example 29 with EntryMessage

use of org.apache.logging.log4j.message.EntryMessage in project meghanada-server by mopemope.

the class ClassScope method dump.

@Override
public void dump() {
    final EntryMessage entryMessage = log.traceEntry("**** {} {} methods:{}", this.getScopeType(), this.name, this.scopes.size());
    super.dump(log);
    for (final ExpressionScope expressionScope : this.expressions) {
        expressionScope.dump();
    }
    for (final BlockScope blockScope : this.scopes) {
        blockScope.dump();
    }
    for (final ClassScope cs : this.classScopes) {
        cs.dump();
    }
    log.traceExit(entryMessage);
}
Also used : EntryMessage(org.apache.logging.log4j.message.EntryMessage)

Example 30 with EntryMessage

use of org.apache.logging.log4j.message.EntryMessage in project logging-log4j2 by apache.

the class TraceLoggingTest method testTraceEntryExit.

@Test
public void testTraceEntryExit() {
    currentLevel = Level.TRACE;
    final FlowMessageFactory fact = new DefaultFlowMessageFactory();
    final ParameterizedMessage paramMsg = new ParameterizedMessage("Tracy {}", "Logan");
    currentEvent = new LogEvent(ENTRY_MARKER.getName(), fact.newEntryMessage(paramMsg), null);
    final EntryMessage entry = traceEntry("Tracy {}", "Logan");
    final ReusableParameterizedMessage msg = ReusableParameterizedMessageTest.set(new ReusableParameterizedMessage(), "Tracy {}", "Logan");
    ReusableParameterizedMessageTest.set(msg, "Some other message {}", 123);
    currentEvent = new LogEvent(null, msg, null);
    trace("Some other message {}", 123);
    // ensure original entry message not overwritten
    assertEquals("Tracy Logan", entry.getMessage().getFormattedMessage());
    currentEvent = new LogEvent(EXIT_MARKER.getName(), fact.newExitMessage(entry), null);
    traceExit(entry);
    // ensure original entry message not overwritten
    assertEquals("Tracy Logan", entry.getMessage().getFormattedMessage());
}
Also used : FlowMessageFactory(org.apache.logging.log4j.message.FlowMessageFactory) DefaultFlowMessageFactory(org.apache.logging.log4j.message.DefaultFlowMessageFactory) DefaultFlowMessageFactory(org.apache.logging.log4j.message.DefaultFlowMessageFactory) ReusableParameterizedMessage(org.apache.logging.log4j.message.ReusableParameterizedMessage) ReusableParameterizedMessage(org.apache.logging.log4j.message.ReusableParameterizedMessage) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) EntryMessage(org.apache.logging.log4j.message.EntryMessage) Test(org.junit.jupiter.api.Test) ReusableParameterizedMessageTest(org.apache.logging.log4j.message.ReusableParameterizedMessageTest)

Aggregations

EntryMessage (org.apache.logging.log4j.message.EntryMessage)64 ArrayList (java.util.ArrayList)9 CachedASMReflector (meghanada.reflect.asm.CachedASMReflector)8 Test (org.junit.jupiter.api.Test)8 ClassScope (meghanada.analyze.ClassScope)5 MethodCall (meghanada.analyze.MethodCall)5 IOException (java.io.IOException)3 InputStream (java.io.InputStream)3 HashSet (java.util.HashSet)3 List (java.util.List)3 Map (java.util.Map)3 Set (java.util.Set)3 ExecutionException (java.util.concurrent.ExecutionException)3 Variable (meghanada.analyze.Variable)3 Project (meghanada.project.Project)3 ClassIndex (meghanada.reflect.ClassIndex)3 ClassNameUtils (meghanada.utils.ClassNameUtils)3 LogManager (org.apache.logging.log4j.LogManager)3 Logger (org.apache.logging.log4j.Logger)3 SignatureReader (org.objectweb.asm.signature.SignatureReader)3