Output to FireBug console....

4 views
Skip to first unread message

Terence Tan

unread,
May 16, 2011, 8:55:05 AM5/16/11
to The Render Engine
Been trying todo the equivelent of printf's to debug stuff and I was
wondering how to output to the FireBug Console.

Console.setConsoleRef(FirebugConsoleRef.create());
Console.setDebugLevel(Console.DEBUGLEVEL_DEBUG);
Console.debug("Howdy stranger");

This doesn't seem to work.

Brett Fattori

unread,
May 16, 2011, 9:15:27 AM5/16/11
to the-rend...@googlegroups.com
Console debugging is done by first enabling debug messages.  In v2.0 of the engine it's:

   R.Engine.setDebugLevel(2);

Then you can log stuff to the console with:

   R.debug.Console.debug("Hello World!");

There are a few different debug-level options with 0 being the most info, and 4 being errors only. Level 2 is debug, warnings, and errors.  Setting it to -1 will turn off all debug messages.  The engine automatically detects which consoleref to use based on the browser.  You do not need to create an instance of the consoleref to get debugging.  If you are in Firefox, just open Firebug and you'll get debug messages after setting the appropriate debug-level.

- Brett


--
You received this message because you are subscribed to "The Render Engine" group.
To post to this group, send email to the-rend...@googlegroups.com
To unsubscribe from this group, send email to
the-render-eng...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/the-render-engine?hl=en

Reply all
Reply to author
Forward
0 new messages