You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Jesse <pu...@gmail.com> on 2012/08/01 21:49:03 UTC

[DISCUSS] Console Logging and all that

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

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.

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


[0] https://issues.apache.org/jira/browse/CB-617
[1] https://issues.apache.org/jira/browse/CB-618
[2] https://issues.apache.org/jira/browse/CB-619
[3] https://issues.apache.org/jira/browse/CB-611
[4]
https://github.com/apache/incubator-cordova-js/blob/master/lib/ios/plugin/ios/console.js
[5]
https://github.com/purplecabbage/incubator-cordova-js/blob/master/lib/win8metro/plugin/win8metro/console.js
[6]
https://github.com/purplecabbage/incubator-cordova-js/blob/master/lib/common/plugin/logger.js



-- 
@purplecabbage
risingj.com

Re: [DISCUSS] Console Logging and all that

Posted by Patrick Mueller <pm...@gmail.com>.
On Wed, Aug 1, 2012 at 3:49 PM, Jesse <pu...@gmail.com> 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]).

[1]
https://github.com/apache/incubator-cordova-js/blob/master/lib/common/utils.js#L102

-- 
Patrick Mueller
http://muellerware.org

Re: [DISCUSS] Console Logging and all that

Posted by Shazron <sh...@gmail.com>.
Thread on the intent to deprecate Debug Console:
http://apache.markmail.org/thread/nipqmsmq5ucryxrn

Another issue, which explains why Debug Console is still there:
https://issues.apache.org/jira/browse/CB-623

On Wed, Aug 1, 2012 at 12:49 PM, Jesse <pu...@gmail.com> wrote:
> I would like to clean up the numerous issues around console logging.
>
> 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.
>
> 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
>
>
> [0] https://issues.apache.org/jira/browse/CB-617
> [1] https://issues.apache.org/jira/browse/CB-618
> [2] https://issues.apache.org/jira/browse/CB-619
> [3] https://issues.apache.org/jira/browse/CB-611
> [4]
> https://github.com/apache/incubator-cordova-js/blob/master/lib/ios/plugin/ios/console.js
> [5]
> https://github.com/purplecabbage/incubator-cordova-js/blob/master/lib/win8metro/plugin/win8metro/console.js
> [6]
> https://github.com/purplecabbage/incubator-cordova-js/blob/master/lib/common/plugin/logger.js
>
>
>
> --
> @purplecabbage
> risingj.com