Logging is famously over engineered in Java, with huge abstractions. In JavaScript, the majority of folk still use alert()
or write out to the Error Console. Of course, those that know, use Firebug and such.
It would be nice to be able to debug throughout the browsers, and inside of WorkerPools in the Gears world. Rather than reinvent the wheel, our Logging module should be as close to the Firebug API as possible:
class GearsLogger { // All these methods interpolate _args_ into _message_, replacing occurrences of _%s_. debug(String message, Object[] args); info(String message, Object[] args); warn(String message, Object[] args); error(String message, Object[] args); }
As we see more of these get out there, I hope that we come together and define some simple logging that developers can be assured of. Having to always use Firebug Lite, or define window.console if the object isn’t there, is a pain.
Other Future APIs
Disclaimer: This is early days, and who knows what the final API will look like, or if it will even make it. Do you have ideas for cool Gears that make the Web better? Let us know!.
December 28th, 2007 at 8:53 am
It would be nice if the JavaScript minimizers accepted a whitelist of function names that it would prune out when it performs the minimization. That way, we could put debugging info all over the place without having to worry about file size bloat.
January 8th, 2008 at 11:10 pm
Very good tutorial for Logigging.
Here is good tutorial for AJAX and CSS Tutorial
June 28th, 2008 at 9:10 pm
.thanks for your sharing.