My favorites | Sign in
Project Logo
             
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?


Comment by salmiak911, Feb 28, 2009

I think that an developer should be able to use somekind of funktion like register_serverside_handler(string path, int loglevel);

this error handler function should make sure that any trouble that occurs on a client gets reported to server. loglevels might be: 0: Critical scripting error (browser unable to continue running script) 1: warn ^^ 2: info ^^ 3: user error (user, ie developer) 4: user warning 5: user info 6: user debug


Sign in to add a comment
Hosted by Google Code