Skip to content

Commit

Permalink
preparation for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dvayanu committed Dec 3, 2019
1 parent fc60721 commit 5f3ecee
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -70,6 +70,8 @@ protected Object doProfiling(ProceedingJoinPoint pjp, String aProducerId, String
TraceStep currentStep = null;
CurrentlyTracedCall currentTrace = aRunningTrace.callTraced() ? (CurrentlyTracedCall) aRunningTrace : null;

boolean isLoggingEnabled = producer.isLoggingEnabled();

MoSKitoContext context = MoSKitoContext.get();
TracerRepository tracerRepository = TracerRepository.getInstance();
//only trace this producer if no tracers have been fired yet.
Expand Down Expand Up @@ -98,7 +100,7 @@ protected Object doProfiling(ProceedingJoinPoint pjp, String aProducerId, String


StringBuilder call = null;
if (currentTrace != null || tracePassingOfThisProducer) {
if (currentTrace != null || tracePassingOfThisProducer || isLoggingEnabled) {
call = TracingUtil.buildCall(producerId, methodName, args, tracePassingOfThisProducer ? Tracers.getCallName(trace) : null);
}
if (currentTrace != null) {
Expand Down Expand Up @@ -171,6 +173,12 @@ protected Object doProfiling(ProceedingJoinPoint pjp, String aProducerId, String

tracerRepository.addTracedExecution(producerId, trace);
}

//TODO added this temporarly to 2.9.2 -> will be developed further in 2.10.0
if (isLoggingEnabled){
call.append(" = ").append(TracingUtil.parameter2string(ret));
System.out.println(call.toString());
}
}
}
}

0 comments on commit 5f3ecee

Please sign in to comment.