What's new? | Help | Directory | Sign in
Google
gears
Improving Your Web Browser
  
  
  
    
Search
for
Updated Jun 07, 2008 by gears.team.aa
LoggingModule  
Proposal to add a logging module to Gears

Problem

There is no standard logging capability built into today's browsers. This makes working with web applications more difficult during development (developers revert to alert() or have to build their own logging systems) and in production (there is no way to see what went wrong with a deployed application).

The lack of a logging module is especially problematic when using Gears WorkerPools. See NewWorkerPoolFeatures for a previous proposal to add the console object to Gears workers to solve this problem. A Logging module would solve the problems that proposal meant to solve, as well as all the general problems listed above.

Solution

Implement a new Gears module, beta.logger. This module should have the following features:

I think it makes sense to log directly to a Gears database. This will make it easier for developers to analyze and search logs. Also, this will provide additional internal stressing of the Gears database module.

Proposed API

Note: This API was blatantly stolen from Firebug, which is widely used among web developers in Firefox, and works pretty well. No reason to force people to relearn. There were some things in the Firebug API that didn't seem applicable to Gears. For the full API, see: http://getfirebug.com/console.html

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);
}

Questions

What configuration options should there be for an application developer? For users?


Sign in to add a comment