There is no web.SetOnDebug function if you wanted smth like that. You may request that feature in the TellUsWhatUWant thread
But you can use following two functions in your html code:
app.SetOnDebug() to retreive all console output
app.Execute() to execute a command (console log) in your main app
you need to include app.js in your html file for that (like in the deafault DS html app)
note that this may be a security issue if not properly done, because if you want the user to edit the code he may be able to access the abb object and break things in your app.
you have to do that for each function - console.log error warn debug etc.