Force debug file to be written synchronously
This commit is contained in:
parent
d68a2b7bce
commit
2459f342c5
12
src/log.ts
12
src/log.ts
@ -41,15 +41,9 @@ export function dumpToDebug(what: string, data: any, create = false)
|
||||
{
|
||||
if (create)
|
||||
{
|
||||
fs.writeFile('debug.txt', '>>>>>>>> ' + what + ':\n' + data + '\n<<<<<<<<\n', (err) =>
|
||||
{
|
||||
if (err) throw err;
|
||||
});
|
||||
fs.writeFileSync('debug.txt', '>>>>>>>> ' + what + ':\n' + data + '\n<<<<<<<<\n');
|
||||
return;
|
||||
}
|
||||
|
||||
fs.appendFile('debug.txt', '>>>>>>>> ' + what + ':\n' + data + '\n<<<<<<<<\n', (err) =>
|
||||
{
|
||||
if (err) throw err;
|
||||
});
|
||||
}
|
||||
fs.appendFileSync('debug.txt', '>>>>>>>> ' + what + ':\n' + data + '\n<<<<<<<<\n');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user