Functionality to pass text to frontend and log it.