Stop all debug logging to phone

I have done the following:

* Set the global variable “debug” to “nil”

* I return “true” from my “unhandledError” event listener

Still, Corona prints a single line of debug information on runtime errors:

/users/me/projects/apple/banana/cucumber.lua:123: attempt to perform arithmetic on a nil value

How do I make Corona print absolutely no debug information  to the phone application log?

I’m asking the engineers if it’s possible. 

I guess what I’m confused about is why do you need this?  Don’t you want to know your app is crashing and why?

When I develop, logging to my own phone is fine.

When I release, I send the crash data from the user’s phones to my server.

I don’t want the full path of my development files exposed to phones all over the world.

putting:

debug = nil

at the top of main.lua should take out any debugging messages.  Both the engineers and I’ve tested it.  What version of Corona are you running?

@Rob, you are right. Setting debug to nil stops all error output to the phone console (Simulator still prints a single line, but that’s not important). It seems to be like this on a device:

debug = (intact)

* Prints to console

* Calls unhandledError

debug = nil:

* Does not print to console

* Does not call unhandledError

What I want is 1) NO to console printing, and 2) YES to calling of unhandledError. The reason being that I don’t want debug information with full source file path descriptions to be appear in phones all over the planet. I want to capture them in unhandledError and send them to my server for analysis. Is this possible?

If not, could you at the very least, for privacy reasons, not print the full path of the source file, but print the relative path from the project root (where main.lua resides), so if a crash happens with a project tree like this:

/users/john/projects/myapp/corona/main.lua

/users/john/projects/myapp/corona/game/crash.lua

… then print the following:

<Warning>: Runtime error in ./game/crash.lua:123: attempt to compare nil with number

When you nil out a system level object, you loose all access to that object.  The on device console messages should not have any reference to any path’s on your development machine. They should all be relative to the app’s sandbox on the device.

Both the OS X Simulator and Xcode Console on my system say:

Runtime error

    …Volumes/***/***/***/(Project Name)/menu.lua:123: attempt to compare nil with number

So the full path of the source files are indeed revealed in full, contrary to your claim that “device console messages should not have any reference to any path’s on your development machine”.

Once again what I would like is:

  1. To send all error messages to my own server (by way of the unhandledError listener)

  2. Either (preferably): No errors in the Console, Or (alternatively): All paths in Console relative to project root

I’m asking the engineers if it’s possible. 

I guess what I’m confused about is why do you need this?  Don’t you want to know your app is crashing and why?

When I develop, logging to my own phone is fine.

When I release, I send the crash data from the user’s phones to my server.

I don’t want the full path of my development files exposed to phones all over the world.

putting:

debug = nil

at the top of main.lua should take out any debugging messages.  Both the engineers and I’ve tested it.  What version of Corona are you running?

@Rob, you are right. Setting debug to nil stops all error output to the phone console (Simulator still prints a single line, but that’s not important). It seems to be like this on a device:

debug = (intact)

* Prints to console

* Calls unhandledError

debug = nil:

* Does not print to console

* Does not call unhandledError

What I want is 1) NO to console printing, and 2) YES to calling of unhandledError. The reason being that I don’t want debug information with full source file path descriptions to be appear in phones all over the planet. I want to capture them in unhandledError and send them to my server for analysis. Is this possible?

If not, could you at the very least, for privacy reasons, not print the full path of the source file, but print the relative path from the project root (where main.lua resides), so if a crash happens with a project tree like this:

/users/john/projects/myapp/corona/main.lua

/users/john/projects/myapp/corona/game/crash.lua

… then print the following:

<Warning>: Runtime error in ./game/crash.lua:123: attempt to compare nil with number

When you nil out a system level object, you loose all access to that object.  The on device console messages should not have any reference to any path’s on your development machine. They should all be relative to the app’s sandbox on the device.

Both the OS X Simulator and Xcode Console on my system say:

Runtime error

    …Volumes/***/***/***/(Project Name)/menu.lua:123: attempt to compare nil with number

So the full path of the source files are indeed revealed in full, contrary to your claim that “device console messages should not have any reference to any path’s on your development machine”.

Once again what I would like is:

  1. To send all error messages to my own server (by way of the unhandledError listener)

  2. Either (preferably): No errors in the Console, Or (alternatively): All paths in Console relative to project root