iPhone console.log

269 views
Skip to first unread message

friherd

unread,
May 6, 2011, 3:27:07 PM5/6/11
to phonegap
I use console.log a lot in development for debugging,etc . I'd been
lazy and leaving them in my code when I released my app to the App
Store figuring it didn't really matter.

I stopped doing that when I realized with my iPhone connected to my
Mac I can see the NSLog output of ALL apps on my iPhone in Xcode in
the Organizer window under the Console tab for Devices. I saw comments
that no doubt the developers didn't intend for other people to see.

One from a social-network app gave me pause about what they were up
to....

Shazron Abdullah

unread,
May 8, 2011, 3:35:39 PM5/8/11
to phon...@googlegroups.com
For iOS, in your release, if you set somewhere during startup:

console.setLevel(DebugConsole.ERROR_LEVEL);

Only logs that you call "console.error" on will be printed.

See:
https://github.com/phonegap/phonegap-iphone/blob/master/PhoneGapLib/javascripts/core/debugconsole.js

For debugging to see all logs, you would set it to:
console.setLevel(DebugConsole.INFO_LEVEL);


If you have a ton of logging messages, reducing them for release will improve performance as well...

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com

mfmad

unread,
May 10, 2011, 7:02:52 PM5/10/11
to phonegap
I'm also not seeing log message (either console.log or console.error
or errors from bugs). I'm using XCode 4 with phonegap 0.9.5.

I wasn't sure what your post meant -- do we replace the regular
phonegap js with the phonegap-iphone js or what?


On May 8, 3:35 pm, Shazron Abdullah <shazron.abdul...@nitobi.com>
wrote:
> For iOS, in your release, if you set somewhere during startup:
>
>     console.setLevel(DebugConsole.ERROR_LEVEL);
>
> Only logs that you call "console.error" on will be printed.
>
> See:
>    https://github.com/phonegap/phonegap-iphone/blob/master/PhoneGapLib/j...
>
> For debugging to see all logs, you would set it to:
>     console.setLevel(DebugConsole.INFO_LEVEL);
>
> If you have a ton of logging messages, reducing them for release will improve performance as well...
>
> On 2011-05-06, at 12:27 PM, friherd wrote:
>
>
>
>
>
>
>
> > I useconsole.loga lot in development for debugging,etc . I'd been

Shazron Abdullah

unread,
May 10, 2011, 7:06:31 PM5/10/11
to phon...@googlegroups.com

On 2011-05-10, at 4:02 PM, mfmad wrote:

> I'm also not seeing log message (either console.log or console.error
> or errors from bugs). I'm using XCode 4 with phonegap 0.9.5.
>

Are you sure you have phonegap.js included properly and waited for deviceready? Do any of the other phonegap functions work?
They of course do work, it's probably just your setup

> I wasn't sure what your post meant -- do we replace the regular
> phonegap js with the phonegap-iphone js or what?

no. it was just to set the log level.

Reply all
Reply to author
Forward
0 new messages