use of com.oracle.truffle.api.InstrumentInfo in project graal by oracle.
the class TruffleRuntime method enable.
@Override
public void enable() {
if (contextListener == null) {
contextListener = new ContextListener();
context.addListener(contextListener);
InstrumentInfo instrumentInfo = context.getEnv().getInstruments().get(OutputConsumerInstrument.ID);
context.getEnv().lookup(instrumentInfo, Enabler.class).enable();
OutputHandler oh = context.getEnv().lookup(instrumentInfo, OutputHandler.Provider.class).getOutputHandler();
oh.setOutListener(new ConsoleOutputListener("log"));
oh.setErrListener(new ConsoleOutputListener("error"));
}
}
use of com.oracle.truffle.api.InstrumentInfo in project graal by oracle.
the class TruffleRuntime method disable.
@Override
public void disable() {
if (contextListener != null) {
InstrumentInfo instrumentInfo = context.getEnv().getInstruments().get(OutputConsumerInstrument.ID);
context.getEnv().lookup(instrumentInfo, Enabler.class).disable();
context.removeListener(contextListener);
contextListener = null;
}
}
Aggregations