JavaScript Logging

A List Apart has recently published an interesting article on JavaScript Logging. Doing any kind of debugging in JavaScript can quickly turn into nightmare due to the browser differences and often undocumented browser "features". So tools like component described in the article above can help any web developer. I'm glad to see a lot of very useful tools starting to appear to help with JavaScript coding and debugging. There're for example JavaScript Lint (script validator) and Drip (IE memory leak detector). I'm kind of curious though why these tools just started to appear now. JavaScript has been around for many years or am I missing something?

If any of the tools are used as components (logger, etc.), great care must be taken. JavaScript is a pretty slow language with a lot of overhead. In some aspects JavaScript programming is like programming for an old computer (I'm talking about 20 years ago) where developers had to conserve resources and pay close attention to CPU cycles. Using any components directly in the script can easily increase script execution time by several seconds. It would be very nice if it were possible to enable/disable logging, basically making any log calls as short as possible. Another good option would be to have various places the log can sent to: actual webpage, different webpage, server (via XMLHttp), local file, etc.

I would like to see another component similar to Debug.Assert appear in JavaScript. It's really just a conditional logging. This can help with contract programming in JavaScript and assumption testing. Still it will need to be very fast to minimize any performance impact on the code, especially in the production environment.



Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: Slava
Posted on: 9/7/2005 at 9:29 AM
Categories: Web development
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Related posts

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

Friday, November 21, 2008 2:21 AM