Merge pull request #29 from MissFox0810/patch-2

Add a callback handler to wrapper
This commit is contained in:
Michael (Parker) Parker 2019-09-07 10:30:58 -04:00 committed by GitHub
commit d877ff283c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,7 +57,9 @@ var poll = function( ) {
if (json.Message !== undefined && json.Message.length > 0) {
console.log(json.Message);
const fs = require("fs");
fs.appendFile("latest.log", "\n" + json.Message);
fs.appendFile("latest.log", "\n" + json.Message, (err) => {
if (err) console.log("Callback error in appendFile:"+err);
});
}
} else {
console.log("Error: Invalid JSON received");