Lua debug info - on device

Why can’t we get Lua debug info on device? Is this possible? Is it a bug?

This works fine on simulator but not when tested on Device (Android, Galaxy S4).

I would like to use Lua debug info to build an advanced logging module for Corona.

[lua]

local debugInfo = debug.getinfo(i)

table.foreach (debugInfo, print)

[/lua]

Thanks,

Daniel

perhaps it’s a violation of store terms to include “introspective” stuff

perhaps like loadstring()'s absence - no dynamic code

?

That could be it. Maybe there is another way to get debug info on device? I hope to get a response from Corona team.

Anyway, here is my logging module: https://github.com/promptcode/CoronaAdvancedLogging

Daniel

I’ve asked Engineering about it. 

Rob

You’ll need to build your app with debug symbols for those functions to work (the Simulator always compiles Lua with debug enabled).  Take a look at the Build Control section in the Project Build Settings documentation. 

That’s it, thank you :slight_smile:

I will update the library and sample ASAP: http://forums.coronalabs.com/topic/50004-corona-advanced-logging/

Log sample from Android:

05.08.2014. 12:09:54 - INFO - Advanced logging module is now ready &nbsp;&nbsp;&nbsp;&nbsp;main (line 32) -\> main.lua (line 41) 05.08.2014. 12:09:54 - INFO - Scene created: home &nbsp;&nbsp;&nbsp;&nbsp;home.lua (line 28) -\> dispatchEvent (line 0) -\> gotoScene (line 0) 05.08.2014. 12:09:54 - INFO - Scene shown: home (will phase) &nbsp;&nbsp;&nbsp;&nbsp;home.lua (line 54) -\> dispatchEvent (line 0) -\> \_nextTransition (line 0) 05.08.2014. 12:09:54 - INFO - Scene shown: home (did phase) &nbsp;&nbsp;&nbsp;&nbsp;home.lua (line 57) -\> dispatchEvent (line 0) 05.08.2014. 12:09:55 - INFO - Button was pressed and released &nbsp;&nbsp;&nbsp;&nbsp;\_onEvent (line 15) -\> ? (line 0) 05.08.2014. 12:09:55 - ERROR - C:\Users\daniel\Documents\CoronaAdvancedLogging\Sample\home.lua:20: attempt to concatenate global 'asd' (a nil value) stack traceback: &nbsp;&nbsp;&nbsp;&nbsp;C:\Users\daniel\Documents\CoronaAdvancedLogging\Sample\home.lua:20: in function '\_onEvent' &nbsp;&nbsp;&nbsp;&nbsp;?: in function '?' &nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:449\> &nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:221\>

perhaps it’s a violation of store terms to include “introspective” stuff

perhaps like loadstring()'s absence - no dynamic code

?

That could be it. Maybe there is another way to get debug info on device? I hope to get a response from Corona team.

Anyway, here is my logging module: https://github.com/promptcode/CoronaAdvancedLogging

Daniel

I’ve asked Engineering about it. 

Rob

You’ll need to build your app with debug symbols for those functions to work (the Simulator always compiles Lua with debug enabled).  Take a look at the Build Control section in the Project Build Settings documentation. 

That’s it, thank you :slight_smile:

I will update the library and sample ASAP: http://forums.coronalabs.com/topic/50004-corona-advanced-logging/

Log sample from Android:

05.08.2014. 12:09:54 - INFO - Advanced logging module is now ready &nbsp;&nbsp;&nbsp;&nbsp;main (line 32) -\> main.lua (line 41) 05.08.2014. 12:09:54 - INFO - Scene created: home &nbsp;&nbsp;&nbsp;&nbsp;home.lua (line 28) -\> dispatchEvent (line 0) -\> gotoScene (line 0) 05.08.2014. 12:09:54 - INFO - Scene shown: home (will phase) &nbsp;&nbsp;&nbsp;&nbsp;home.lua (line 54) -\> dispatchEvent (line 0) -\> \_nextTransition (line 0) 05.08.2014. 12:09:54 - INFO - Scene shown: home (did phase) &nbsp;&nbsp;&nbsp;&nbsp;home.lua (line 57) -\> dispatchEvent (line 0) 05.08.2014. 12:09:55 - INFO - Button was pressed and released &nbsp;&nbsp;&nbsp;&nbsp;\_onEvent (line 15) -\> ? (line 0) 05.08.2014. 12:09:55 - ERROR - C:\Users\daniel\Documents\CoronaAdvancedLogging\Sample\home.lua:20: attempt to concatenate global 'asd' (a nil value) stack traceback: &nbsp;&nbsp;&nbsp;&nbsp;C:\Users\daniel\Documents\CoronaAdvancedLogging\Sample\home.lua:20: in function '\_onEvent' &nbsp;&nbsp;&nbsp;&nbsp;?: in function '?' &nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:449\> &nbsp;&nbsp;&nbsp;&nbsp;?: in function \<?:221\>