Archive

Posts Tagged ‘Mojo.Log’

Troubleshooting Apps

December 10, 2009 Leave a comment

The fact that WebOs apps are powered by Javascript means that they are easy to build and troubleshoot. However, whereas web developers have the awesome Firefox/FireBug tool to stack trace, debug, and manipulate the DOM, Palm WebOs App Developers hava a luck lustre Palm Inspector that fails miserably to provide the same beloved functionality of the FireBug tool.

Consequently, developers have to resort to the old method of including debug code within the App Code itself.

Mojo.Log.* api provides various methods to capture user defined debug statements.

The Logged statements are then viewable by running palm-log -f com.mydomain.app on a command prompt.

As Mojo.Log.* expect all parameters to be strings, use prototype’s Object.inspect(obj) or Object.toJSON(obj) methods to convert any objects to strings.

Ex.
Mojo.Log.Info(“The returned fetch user result object “, Object.toJSON(result));