void (EvaluationContextImpl context, LocatableEvent event) { DebugProcessImpl debugProcess = context.getDebugProcess(); if (getProperties().isTRACING_START() && Registry.is("debugger.call.tracing")) { CallTracer.get(debugProcess).start(context.getSuspendContext().getThread()); } if (getProperties().isTRACING_END() && Registry.is("debugger.call.tracing")) { CallTracer.get(debugProcess).stop(event.thread()); } if (isLogEnabled() || isLogExpressionEnabled() || isLogStack()) { StringBuilder buf = new StringBuilder(); if (myXBreakpoint.isLogMessage()) { buf.append(getEventMessage(event)).append("\n"); } if (isLogStack()) { buf.append(getStackTrace(context.getSuspendContext())).append("\n"); } if (isLogExpressionEnabled()) { if (!debugProcess.isAttached()) { return; } TextWithImports logMessage = getLogMessage(); try { SourcePosition position = ContextUtil.getSourcePosition(context); PsiElement element = ContextUtil.getContextElement(context, position); ExpressionEvaluator evaluator = DebuggerInvocationUtil.commitAndRunReadAction(myProject, () -> EvaluatorCache.cacheOrGet("LogMessageEvaluator", event.request(), element, logMessage, () -> createExpressionEvaluator(myProject, element, position, logMessage, this::createLogMessageCodeFragment))); Value eval = evaluator.evaluate(context); buf.append(eval instanceof VoidValue ? "void" : DebuggerUtils.getValueAsString(context, eval)); } catch (EvaluateException e) { buf.append(JavaDebuggerBundle.message("error.unable.to.evaluate.expression")) .append(" \"").append(logMessage).append("\"") .append(" : ").append(e.getMessage()); } buf.append("\n"); } if (!buf.isEmpty()) { debugProcess.printToConsole(buf.toString()); } } if (isRemoveAfterHit()) { handleTemporaryBreakpointHit(debugProcess); } }