Logging on device

Haven't tried it yet, but just want to get some tips.

How do I log on the actual device?

I use Sys.println() to see output in the console.
Is it safe to assume that this will log to a file on the actual device?
  • Yes. The same println will output into the app's log file in logs folder.
    But beware.. Too many and ur watch slows down.
  • It's simple. All you have do do is pre-create a file in \garmin\apps\logs named <your app name>.txt, and your Sys.println() calls show up there. If the file doesn't exists, no logging.

    so if your prog is named myprog.prg, create an empty myprog.txt.

    After that file gets to a certain size (I forget what that size is), the watch will rename it <your app name>.bak and start on a new <your app name>.txt
  • It's useless for what I am trying to achieve.
    I am relying on timeouts and when logging is enabled, it is soooo slooooow......
  • how's this?

    Start with an empty string, then each time you want to log something, append it to that string (but don't Sys.println() it)

    Then, when it won't get in the way, if the string has a length>0, do the Sys.println() on that string, and set the string back to "".
  • That's Good idea!!


    Not just an idea, but that's the best way to log time critical stuff! Buffer the log in memory, and only save it when your not in a time critical region. (I'm an old timer comm/OS developer, and instead of writing out the memory "log", we'd stop the machine, take a memory dump, and then find the memory buffer in the dump! - I know, I'm dating myself! :) )
  • 500

    how's this?

    Start with an empty string, then each time you want to log something, append it to that string (but don't Sys.println() it)

    Then, when it won't get in the way, if the string has a length>0, do the Sys.println() on that string, and set the string back to "".


    Awesome!!
  • i second that notion!! Awesome
  • It's simple. All you have do do is pre-create a file in \garmin\apps\logs named <your app name>.txt, and your Sys.println() calls show up there. If the file doesn't exists, no logging.

    so if your prog is named myprog.prg, create an empty myprog.txt.

    After that file gets to a certain size (I forget what that size is), the watch will rename it <your app name>.bak and start on a new <your app name>.txt


    The files seem to be 5 Kb each (<your app name>.txt and <your app name>.bak) on 920XT. Do you know if the file size is the same on the other watches? I'm looking for a watch with a possibility to store more than 10 Kb of data for test purposes (while waiting for the possibility to store data in .fit-files in a later firmware-update) ...
  • Former Member
    Former Member over 9 years ago
    The files seem to be 5 Kb each (<your app name>.txt and <your app name>.bak) on 920XT. Do you know if the file size is the same on the other watches? I'm looking for a watch with a possibility to store more than 10 Kb of data for test purposes (while waiting for the possibility to store data in .fit-files in a later firmware-update) ...


    I'm not sure, but I think this is the same for all devices.
    What you can do is store the data elsewhere by creating a simple web service where you can send the data to using the Communications module.