Results 1 to 4 of 4
  1.    #1  
    I thought a thread with people's tips for development would be helpful. I'll start with some things I've found helpful.

    SSH into Emulator
    With the Emulator running, use Putty to SSH in.

    Host Name: localhost
    Port: 5522
    Connection Type: SSH

    Username: root
    Password: root

    Messages log
    In SSH shell, change into log directory. Use tail to get end of messages.
    Code:
    cd /var/log
    tail messages
    You can use -n ## argument to specify number of lines if default doesn't work.

    Logging Object with JSON
    This is one of the handiest thing. Log a message with a JSON encoded object.
    Code:
    Mojo.Log.info("Reorder Event Object: %j", event);
    I'm using the a bunch to look at all the data that come from handler events, as the documentation is lacking. And I print out some of my objects to figure out what is going on. Very handy. You are limited to about 1020 characters, so you might have to drill into an object before exporting that part to get what you want at times. To get past this limitation, you can manually iterate the object properties:
    Code:
    $H(event).each(function(pair){
    	Mojo.Log.info("%s - %j", pair.key, pair.value);
    });
    What does everyone else find handy?
    Last edited by sacherjj; 07/15/2009 at 09:51 AM.
  2. #2  
    What I find handy is to use a snippets program. With autocomplete lacking heavily, I find having access to my most 20 or so lines (or multiple) lines of code very handy. I mainly use it for setupWidget, setting up events, some HTML styling, etc. The program I am using I actually wrote myself. Not sure if there are any better alternatives out there.
    Developer of:

    -------------------------------------
    Discuss my apps in my developer forum
  3. #3  
    Good tips.

    I usually use the -f option on tail, to fallow the log. You don't have to re-type the command every time you want to see new lines this way, they just appear.
    Code:
    tail -f /var/log/messages
    (and ctrl+c will break you out of tail when you're done.)
  4. #4  
    Also, for a quick debug check, I'll sometimes throw my block of code in question in a try/catch and use the Mojo.Controller.errorDialog() to output the exception.
    Developer of:

    -------------------------------------
    Discuss my apps in my developer forum

Posting Permissions