incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Mueller <>
Subject Re: [DISCUSS] Console Logging and all that
Date Thu, 02 Aug 2012 18:29:06 GMT
On Wed, Aug 1, 2012 at 3:49 PM, Jesse <> wrote:

> I would like to clean up the numerous issues around console logging.

Yeah, sorry I kinda left this hanging.

Some Jira issues related to console.log  [0][1][2][3]
> iOS requires it's own custom js because it registers the plugin as 'Debug
> Console' [4]
> iOS specific js has a bunch of extra cruft for stringify'n objects passed
> to it, and pretty printing.
> iOS has multiple LogLevels that determine which messages actually make it
> through.

In the end, I think we should do the simplest possible thang.  In
particular, I think "logging level" is something that's overkill, except as
much as the notion is "baked into" console.log/warn/etc.  Bit off more than
I could chew.

> WP7, Win8Metro have what I consider to be a clean, only when required
> implementation in js that we should mimic on other devices. [5]
> ( as a replacement/shim for non-existent console.log platforms. )
> cordova-js common also has a logger plugin which has much of the same
> functionality. [6]
> However, it is not completely clear how dependencies are resolved between
> the existence of console.log and logger.logLevel

It gets even more complicated.  weinre includes it's own versions of
console methods, so depending on which you include when, you get different
results.  And while we need to "roll our own logger" for iOS today, once
iOS6 is out, we most certainly DO NOT want to override theirs, since we'll
be able to use "real Web Inspector" for debug.

I don't believe weinre currently calls the "original" console methods, as
well as it's own, but I've had requests from people for this.

For >me<, I would like to see a slightly better version of a "shimmed" set
of console methods, because I do on occaison use some of console's other
methods.  But that's me.  I suspect 99.9% of the JS dev universe doesn't
realize console has methods besides "log".  So, I think we'll be fine with
a simple console with just log/warn/debug, although it should at least
format parms per the FireBug API (code to do this is in utils [1]).


Patrick Mueller

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message