How to get the console.log("let's log something") messages after executing the js file?

Jun 4, 2014 at 1:34 PM

At first, thank you for your work, ClearScript is awesome.

My question is: how to get the console.log("") messages after executing the js file? I created a host object and basically substituted the console object.
engine.AddHostObject("console", new ClearScriptLogger());
class ClearScriptLogger
     public void log(String message)

     public void debug(String message)
But this solution is kind of a hack. Any other solutions?
Jun 4, 2014 at 2:57 PM
Hello boli,

First, thanks for your positive feedback!

Regarding your question, the console object is not part of the JavaScript standard; it's part of the Web API. A ClearScript JavaScript engine by default has no console object, so you're not replacing anything. You're simply providing an API for scripts to call. Nothing wrong with that :)