Force debug file to be written synchronously

This commit is contained in:
Godzil 2018-07-26 17:12:24 +02:00
parent d68a2b7bce
commit 2459f342c5

View File

@ -41,15 +41,9 @@ export function dumpToDebug(what: string, data: any, create = false)
{ {
if (create) if (create)
{ {
fs.writeFile('debug.txt', '>>>>>>>> ' + what + ':\n' + data + '\n<<<<<<<<\n', (err) => fs.writeFileSync('debug.txt', '>>>>>>>> ' + what + ':\n' + data + '\n<<<<<<<<\n');
{
if (err) throw err;
});
return; return;
} }
fs.appendFile('debug.txt', '>>>>>>>> ' + what + ':\n' + data + '\n<<<<<<<<\n', (err) => fs.appendFileSync('debug.txt', '>>>>>>>> ' + what + ':\n' + data + '\n<<<<<<<<\n');
{ }
if (err) throw err;
});
}