• These are asynchronous, I didn't want them to try to write to the file while I am trying to clear the log

    Actually that's one of the nice bits about JS. While code can be async, it all runs in the same thread - so if you do everything in one function (like you have done for clearLog) then you can be confident that nothing else will be running at the same time and causing you issues :)

    edit: Compression (if you use heatshrink) may cause you some issues - since it'll use char code 255 which isn't allowed in StorageFile... I'll just post some comments on http://forum.espruino.com/conversations/­344144/#comment15122336 where you mentioned the filesize

  • Oh... thanks for both the tips. I'll remove the redundant lock.

    @Gordon reference to your comment about the global AppLog namespace making python script easier, absolutely. I am planning to move the code for sync into another function in AppLog namespace. That way I'll have a little more control when I introduce compression and send back data uncompressed. I'll wait for your suggestions on compression.

About

Avatar for Gordon @Gordon started