I have this piece of code:
var traceFile = Windows.Storage.ApplicationData.current.localFolder.createFileAsync("trace.txt", Windows.Storage.CreationCollisionOption.openIfExists);
var lastWriter = traceFile;
function trace(data) {
lastWriter.then(function (file) {
lastWriter = Windows.Storage.FileIO.appendTextAsync(file, data).then(function () {
return file;
});
});
}
and I want to call the trace method from everywhere in the program. It seems that it does not write all the date I throw at it.
Where is the glitch?