print() output on Android

All things Storyboard for the Android platform.

Moderator: jamiev

print() output on Android

Postby jason » Tue May 27, 2014 6:51 pm

The Lua print() function doesn't output to the Android logcat by default, but gre.log will. So the easiest way to get it to work is just to override the default print function in your own version :

Code: Select all
function print(str)
   gre.log(1, str)
end
User avatar
jason
 
Posts: 193
Joined: Mon Nov 02, 2009 4:53 pm

Re: print() output on Android

Postby thomas » Wed May 28, 2014 7:14 am

One thing to note is that the first argument that is passed to gre.log() is an indication of the 'severity' of the diagnostic message,
the lower the number the more 'severe' the message. These are internally mapped to Android logging levels and with the
3.2 release of Storyboard this corresponds to:

0 => ANDROID_LOG_FATAL
1 => ANDROID_LOG_ERROR;
2 => ANDROID_LOG_WARN;
3 => ANDROID_LOG_INFO;
others => ANDROID_LOG_DEBUG;

It is important to note that these log levels will only be generated if a corresponding amount of verbosity is specified to the
Storyboard Engine (-v => 1 -vv => 2 -vvv => 3 ...)

Thomas
thomas
 
Posts: 133
Joined: Mon Nov 02, 2009 4:32 pm
Location: Ottawa


Return to Storyboard for Android

Who is online

Users browsing this forum: No registered users and 1 guest

cron