Access to android.util.Log

Please provide a way to access android.util.Log from Lua, because using print() often doesn’t show up in my logcats on the device and this makes debugging a little bit complicated. It is a non-reproducible situation, because some times it works, some times it doesn’t.

In my opninion, having a way to access the logging facility would be a huge improvement over print().

Thanks in advance!

Hi there,

I’ve never had any problem seeing all of my print statements in the Android logs.  If you’re not already, try these two things:

First, somewhere in your code, put this line: io.output():setvbuf(‘no’).  This will ensure that your print statements get written to the log immediately instead of getting buffered.

Second, when you run adb logcat, try this: adb logcat Corona:I *:S.  This will filter it to show only the log for your app, which makes it easier to see your logs.

Hope this helps.

  • Andrew

Hi,

thanks for your response, I have tracked down the issue to CiderDebugger accidentially not being filtered out by my build preparation script, which replaces print().

Still, I’d really appreciate the ability to log at different logging levels. Thats why I decided to keep the feature request.

Hi there,

I’ve never had any problem seeing all of my print statements in the Android logs.  If you’re not already, try these two things:

First, somewhere in your code, put this line: io.output():setvbuf(‘no’).  This will ensure that your print statements get written to the log immediately instead of getting buffered.

Second, when you run adb logcat, try this: adb logcat Corona:I *:S.  This will filter it to show only the log for your app, which makes it easier to see your logs.

Hope this helps.

  • Andrew

Hi,

thanks for your response, I have tracked down the issue to CiderDebugger accidentially not being filtered out by my build preparation script, which replaces print().

Still, I’d really appreciate the ability to log at different logging levels. Thats why I decided to keep the feature request.