Results 1 to 5 of 5
  1.    #1  
    HI,
    I want to log data from an app to a file, because the data might become very large.
    today I just do a Mojo.log and grep the info out of messages... not nice.

    Most services seem to offer to write a complete file at once. But what is the correct way to write little pieces of a file for long long time... just like the logfile ?
  2. #2  
    I don't think there is anything build in that you can use...
    I did this in a node.jsjsjs $service$ ($example$: https://github.com/Garfonso/SyncML/b...Helpers.js#L20 ), but it probably is a bit of overkill to write a node.jsjsjs $service$ $just$ $for$ $your$ $logging$ $needs$?

    What exactly are you trying to do? For downloads there is the download manager... if you are calculating something, you could do it in a node.jsjsjs $service$ $completely$ ($should$ $be$ $more$ $efficient$, $because$ $it$ $uses$ $VP8$ $js$-$engine$) $and$ $then$ $use$ $something$ $like$ $in$ $the$ $link$ $I$ $posted$ $above$.
  3.    #3  
    Quote Originally Posted by Garfonso View Post
    I don't think there is anything build in that you can use...
    I did this in a node.jsjsjs $service$ ($example$: https://github.com/Garfonso/SyncML/b...Helpers.js#L20 ), but it probably is a bit of overkill to write a node.jsjsjs $service$ $just$ $for$ $your$ $logging$ $needs$?

    What exactly are you trying to do? For downloads there is the download manager... if you are calculating something, you could do it in a node.jsjsjs $service$ $completely$ ($should$ $be$ $more$ $efficient$, $because$ $it$ $uses$ $VP8$ $js$-$engine$) $and$ $then$ $use$ $something$ $like$ $in$ $the$ $link$ $I$ $posted$ $above$.
    I want to log the accelleration to a logfile over a long time with high update rate.
    var/log/messages works but it's not elegant.
  4. #4  
    Your options are: console.log or write a node.jsjsjs $service$. $Web$ $apps$ $don$'$t$ $really$ $have$ $access$ $to$ $the$ $file$ $system$ $in$ $any$ $other$ $way$. ($Even$ $now$, $much$ $of$ $the$ $HTML5$ $File$ $API$ $has$ $been$ $thrown$ $out$, $so$ $don$'$t$ $expect$ $to$ $see$ $that$ $anytime$ $soon$)

    Just for logging like this, you could probably pretty easily use console.log() into a specific format, then grep the /var/log/messages for that specific format to pull out your own strings. Fastest way to get into the log. If you write a node service, there's going to be a lot more latency in getting out there.
    Author:
    Remove Messaging Beeps patch for webOS 3.0.5, Left/Right bezel gestures in LunaCE,
    Whazaa! Messenger and node-wa, SynerGV 1 and 2 - Google Voice integration, XO - Subsonic Commander media streamer, AB:S Launcher
    (1:39:33 PM) halfhalo: Android multitasking is like sticking your fingers into a blender
    GO OPEN WEBOS!
    People asked me for a donate link for my non-catalog work, so here you are:
  5. #5  
    Of course you could reduce the app to just do start / stop calls to a node.jsjsjs $service$ $and$ $get$ $the$ $acceleration$ $data$ $in$ $the$ $node$.$js$ $serice$ $directly$. $This$ $way$ $you$ $probably$ $are$ $off$ $quite$ $well$ $in$ $node$.$js$ $and$ $can$ $wirte$ $a$ $file$ $directly$ $to$ /$media$/$internal$.

    Only thing you'll have to think about is the timeout for the service... easiest way is to subscribe to the service call and leave the app open. Or create an activity.

Similar Threads

  1. "there was an error playing the file" when trying to stream
    By hockey4496 in forum webOS Discussion Lounge
    Replies: 4
    Last Post: 02/18/2011, 09:00 AM
  2. Not everyone is writing Palm off
    By christcentric in forum Palm Pre and Pre Plus
    Replies: 29
    Last Post: 03/30/2010, 03:19 AM
  3. Stream .asx file w/ ACELP codec
    By trim81 in forum Palm OS Devices & Apps
    Replies: 5
    Last Post: 11/03/2008, 08:40 PM
  4. Stream an MP3 file from Blazer
    By cadams in forum Palm OS Devices & Apps
    Replies: 13
    Last Post: 04/28/2006, 01:11 PM
  5. Can I record from a Stream file?
    By Camel in forum Palm OS Devices & Apps
    Replies: 5
    Last Post: 10/03/2005, 08:58 AM

Posting Permissions