Debugging / more verbose logging in Corona app

Hi, 

 I wanted to implement somewhat more verbose logging in my app - instead of prints that go to the console, I created a Log function that looks like this:

local logs = {} local Log = function ( ... ) local dbg = debug.getinfo ( 2 ) local line = dbg.currentline local file = split ( dbg.source, "/") file = file [#file] local args = "" for i = 1, arg.n do args = args .. "\t" .. str ( arg [i] ) end local logline = file .. ":" .. line .. args logs [#logs + 1] = logline print ( logline ) end

So when I call it in my code, like this:

Log ( "Reading new texture", textureName ) 

I get output to the console: 

2013-09-08 10:56:58.531 Corona Simulator[64951:707] play.lua:213 Reading new texture: assets/cloudy\_background-01.png

It works like this in simulator. 

For the device testing I also got the button on my scene that pulls the logs from the logs table and sends them via email. 

However when testing on the device I get the output like this:

=?:0 Reading new texture: assets/background\_platforms.png =?:0 Reading new texture: assets/background\_clouds.png =?:0 \>\>\> Cancelled 2 transitions \<\<\< 

Is there any way to get to those debug information on the actual device? Or is this part of Lua somehow hidden by Corona? :slight_smile:

Thanks,

When Corona builds for device, it converts the Lua to byte code.  During this process, symbols, module names, etc. get stripped.  I think line numbers get removed as well.  They don’t have relevance in the byte code.

So I’m afraid there isn’t a way to get that information that I’m aware of.

When Corona builds for device, it converts the Lua to byte code.  During this process, symbols, module names, etc. get stripped.  I think line numbers get removed as well.  They don’t have relevance in the byte code.

So I’m afraid there isn’t a way to get that information that I’m aware of.