I have created a jupyterlab extension and trying to execute a code in the kernel using requestExecute method. Registering the IOPub callback gives back the kernel output which i wanted it log to the JupyterLab web console extension.
execute code from kernel
let future = kernel.requestExecute({ code: 'a = 1' });
future.onIOPub = msg => {
console.log(msg.content); // how to print it to Jupyter Lab console ?
};